Skip to content

Commit ce69dfa

Browse files
committed
Subject: Add module structure
What Happened: - add module structure
1 parent b5ceb10 commit ce69dfa

9 files changed

Lines changed: 164 additions & 137 deletions

File tree

app/index.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!doctype html>
22
<html class="no-js" ng-app="angularAdminlte">
3-
<head>
3+
4+
<head>
45
<meta charset="utf-8">
56
<title>frontend</title>
67
<meta name="description" content="">
@@ -21,8 +22,9 @@
2122
<!-- build:js scripts/modernizr.js -->
2223
<script src="bower_components/modernizr/modernizr.js"></script>
2324
<!-- endbuild -->
24-
</head>
25-
<body>
25+
</head>
26+
27+
<body>
2628
<!--[if lt IE 10]>
2729
<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>
2830
<![endif]-->
@@ -56,12 +58,15 @@
5658

5759
<!-- build:js({app,.tmp}) scripts/main.js -->
5860
<script src="scripts/angularAdminlte.js"></script>
59-
<script src="scripts/main/main-ctrl.js"></script>
61+
<script src="scripts/angularAdminlteModules.js"></script>
62+
<script src="modules/main/main.js"></script>
63+
<script src="modules/dashboard/dashboard.js"></script>
6064

6165
<!-- inject:partials -->
6266
<!-- angular templates will be automaticaly converted in js and inserted here -->
6367
<!-- endinject -->
6468
<!-- endbuild -->
6569

66-
</body>
70+
</body>
71+
6772
</html>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="jumbotron text-center">
2+
<h1>'Allo, 'Allo!</h1>
3+
<p class="lead">
4+
<img src="images/yeoman.png" alt="I'm Yeoman"><br>
5+
Always a pleasure scaffolding your apps.
6+
</p>
7+
<p><a class="btn btn-lg btn-success" ng-href="#">Splendid!</a></p>
8+
</div>
9+
10+
<div class="row">
11+
<div class="col-sm-6 col-md-4" ng-repeat="awesomeThing in awesomeThings | orderBy:'rank'">
12+
<div class="thumbnail">
13+
<img class="pull-right" ng-src="images/{{awesomeThing.logo}}" alt="{{awesomeThing.title}}">
14+
<div class="caption">
15+
<h3>{{awesomeThing.title}}</h3>
16+
<p>{{awesomeThing.description}}</p>
17+
<p><a ng-href="{{awesomeThing.url}}">{{awesomeThing.url}}</a></p>
18+
</div>
19+
</div>
20+
</div>
21+
</div>

app/modules/dashboard/dashboard.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
'use strict';
2+
3+
angular.module('dashboard', ['ui.router'])
4+
.config(function($stateProvider, $urlRouterProvider) {
5+
$stateProvider
6+
.state('main.dashboard', {
7+
url: '/dashboard',
8+
templateUrl: 'modules/dashboard/dashboard.html',
9+
controller: 'DashboardCtrl'
10+
});
11+
12+
$urlRouterProvider.when('/', '/main/dashboard');
13+
})
14+
.controller('DashboardCtrl', function($scope) {
15+
$scope.awesomeThings = [{
16+
'key': 'angular',
17+
'title': 'AngularJS',
18+
'url': 'https://angularjs.org/',
19+
'description': 'HTML enhanced for web apps!',
20+
'logo': 'angular.png'
21+
}, {
22+
'key': 'browsersync',
23+
'title': 'BrowserSync',
24+
'url': 'http://browsersync.io/',
25+
'description': 'Time-saving synchronised browser testing.',
26+
'logo': 'browsersync.png'
27+
}, {
28+
'key': 'gulp',
29+
'title': 'GulpJS',
30+
'url': 'http://gulpjs.com/',
31+
'description': 'The streaming build system.',
32+
'logo': 'gulp.png'
33+
}, {
34+
'key': 'jasmine',
35+
'title': 'Jasmine',
36+
'url': 'http://jasmine.github.io/',
37+
'description': 'Behavior-Driven JavaScript.',
38+
'logo': 'jasmine.png'
39+
}, {
40+
'key': 'karma',
41+
'title': 'Karma',
42+
'url': 'http://karma-runner.github.io/',
43+
'description': 'Spectacular Test Runner for JavaScript.',
44+
'logo': 'karma.png'
45+
}, {
46+
'key': 'protractor',
47+
'title': 'Protractor',
48+
'url': 'https://github.com/angular/protractor',
49+
'description': 'End to end test framework for AngularJS applications built on top of WebDriverJS.',
50+
'logo': 'protractor.png'
51+
}, {
52+
'key': 'jquery',
53+
'title': 'jQuery',
54+
'url': 'http://jquery.com/',
55+
'description': 'jQuery is a fast, small, and feature-rich JavaScript library.',
56+
'logo': 'jquery.jpg'
57+
}, {
58+
'key': 'bootstrap',
59+
'title': 'Bootstrap',
60+
'url': 'http://getbootstrap.com/',
61+
'description': 'Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.',
62+
'logo': 'bootstrap.png'
63+
}, {
64+
'key': 'less',
65+
'title': 'Less',
66+
'url': 'http://lesscss.org/',
67+
'description': 'Less extends the CSS language, adding features that allow variables, mixins, functions and many other techniques.',
68+
'logo': 'less.png'
69+
}];
70+
angular.forEach($scope.awesomeThings, function(awesomeThing) {
71+
awesomeThing.rank = Math.random();
72+
});
73+
});

app/modules/main/main.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<div class="container">
2+
3+
<nav class="navbar navbar-static-top navbar-inverse">
4+
<div class="navbar-header">
5+
<a class="navbar-brand" href="https://github.com/Swiip/generator-gulp-angular">
6+
<span class="glyphicon glyphicon-home"></span> Gulp Angular
7+
</a>
8+
</div>
9+
10+
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-6">
11+
<ul class="nav navbar-nav">
12+
<li class="active"><a ng-href="#">Home</a></li>
13+
<li><a ng-href="#">About</a></li>
14+
<li><a ng-href="#">Contact</a></li>
15+
</ul>
16+
</div>
17+
</nav>
18+
19+
<div ui-view></div>
20+
21+
<hr>
22+
23+
<div class="footer">
24+
<p>With ♥ from <a href="https://twitter.com/Swiip">@Swiip</a></p>
25+
</div>
26+
27+
</div>

app/modules/main/main.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
3+
angular.module('main', ['ui.router'])
4+
.config(function($stateProvider, $urlRouterProvider) {
5+
$stateProvider
6+
.state('main', {
7+
abstract: true,
8+
url: '/main',
9+
templateUrl: 'modules/main/main.html',
10+
controller: 'MainCtrl'
11+
});
12+
})
13+
.controller('MainCtrl', function($scope) {
14+
//TODO
15+
$scope.test = {};
16+
});

app/partials/main.html

Lines changed: 0 additions & 47 deletions
This file was deleted.

app/scripts/angularAdminlte.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
'use strict';
22

3-
angular.module('angularAdminlte', ['ngAnimate', 'ngCookies', 'ngTouch', 'ngSanitize', 'restangular', 'ui.router'])
4-
.config(function ($stateProvider, $urlRouterProvider) {
5-
$stateProvider
6-
.state('home', {
7-
url: '/',
8-
templateUrl: 'partials/main.html',
9-
controller: 'MainCtrl'
10-
});
11-
12-
$urlRouterProvider.otherwise('/');
13-
})
14-
;
3+
angular.module('angularAdminlte', ['ngAnimate',
4+
'ngCookies',
5+
'ngTouch',
6+
'ngSanitize',
7+
'restangular',
8+
'ui.router',
9+
'angularAdminlteModules'
10+
])
11+
.config(function($stateProvider, $urlRouterProvider) {
12+
$urlRouterProvider.otherwise('/');
13+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
angular.module('angularAdminlteModules', [
4+
'main',
5+
'dashboard'
6+
]);

app/scripts/main/main-ctrl.js

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)