Transform sidebar to module

This commit is contained in:
Thibault Cohen 2014-12-17 14:11:28 -05:00
parent 556e4933f4
commit 83be170928
6 changed files with 40 additions and 36 deletions

View File

@ -3,6 +3,7 @@
// Declare app level module which depends on views, and components
angular.module('adagios', [
'ngRoute',
'adagios.sidebar',
'adagios.navbar',
'adagios.tactical'
]).

View File

@ -12,49 +12,40 @@
<link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css">
<link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css">
<link rel="stylesheet" href="app.css">
<script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link href="bower_components/fontawesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Angular -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<!-- Application -->
<script src="app.js"></script>
<script src="components/live/notifications.js"></script>
<!-- MODULES -->
<!-- Sidebar -->>
<script src="sidebar/sidebar.js"></script>
<link rel="stylesheet" href="sidebar/sidebar.css">
<!-- Navbar -->
<script src="navbar/navbar.js"></script>
<link rel="stylesheet" href="navbar/navbar.css">
<script src="tactical/tactical.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js"></script>
<script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div ng-include src="'partials/sidebar/sidebar.html'"></div>
<sidebar></sidebar>
<navbar> </navbar>
<navbar></navbar>
<div ng-view id="page" class="content"></div>
<!-- In production use:
<script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script>
-->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="app.js"></script>
<script src="components/live/notifications.js"></script>
<script src="navbar/navbar.js"></script>
<script src="tactical/tactical.js"></script>
<script src="view1/view1.js"></script>
<script src="view2/view2.js"></script>
<script src="components/version/version.js"></script>
<script src="components/version/version-directive.js"></script>
<script src="components/version/interpolate-filter.js"></script>
</body>
</html>

View File

@ -1,5 +1,3 @@
<link rel="stylesheet" href="navbar/navbar.css">
<nav ng-app="adagios.navbar" id="navbar" class="navbar navbar-default navbar-inverse" role="navigation" ng-controller="NavBarCtrl">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->

View File

@ -1,6 +1,4 @@
<link rel="stylesheet" href="partials/sidebar/sidebar.css">
<div class="nav-side-menu">
<div nv-app="adagios.sidebar" class="nav-side-menu" ng-controller="SideBarCtrl">
<div class="brand">ADAGIOS</div>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>

16
app/sidebar/sidebar.js Normal file
View File

@ -0,0 +1,16 @@
'use strict';
angular.module('adagios.sidebar', [])
.controller('SideBarCtrl', ['$scope', '$http',
function($scope, $http) {
}])
.directive('sidebar', function() {
return {
restrict: 'E',
templateUrl: "sidebar/sidebar.html"
};
});