forked from angular/angular-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refact(*): update overall application architecture to match best prac…
…tices
- Loading branch information
1 parent
9d0b43b
commit e5b915f
Showing
13 changed files
with
152 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* app css stylesheet */ | ||
|
||
.menu { | ||
list-style: none; | ||
border-bottom: 0.1em solid black; | ||
margin-bottom: 2em; | ||
padding: 0 0 0.5em; | ||
} | ||
|
||
.menu:before { | ||
content: "["; | ||
} | ||
|
||
.menu:after { | ||
content: "]"; | ||
} | ||
|
||
.menu > li { | ||
display: inline; | ||
} | ||
|
||
.menu > li:before { | ||
content: "|"; | ||
padding-right: 0.3em; | ||
} | ||
|
||
.menu > li:nth-child(1):before { | ||
content: ""; | ||
padding: 0; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
angular.module('appVersion', []) | ||
.directive('appVersion', ['version', function(version) { | ||
return function(scope, element, attributes, controller) { | ||
element.text(version); | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
/* Filters */ | ||
|
||
angular.module('interpolate', []). | ||
filter('interpolate', ['version', function(version) { | ||
return function(text) { | ||
return String(text).replace(/\%VERSION\%/mg, version); | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
/* Services */ | ||
|
||
// Demonstrate how to register services | ||
// In this case it is a simple value service. | ||
angular.module('appVersionService', []) | ||
.value('version', '0.1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>This is the partial for view 1.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
angular.module('view1', []) | ||
.config(['$routeProvider', function($routeProvider) { | ||
$routeProvider.when('/view1', { | ||
templateUrl: 'components/view1/view1.html', | ||
controller: 'MyCtrl1' | ||
}); | ||
}]) | ||
|
||
.controller('MyCtrl1', ['$scope', function($scope) { | ||
|
||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<p>This is the partial for view 2.</p> | ||
<p> | ||
Showing of 'interpolate' filter: | ||
{{ 'Current version is v%VERSION%.' | interpolate }} | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
angular.module('view2', []) | ||
.config(['$routeProvider', function($routeProvider) { | ||
$routeProvider.when('/view2', { | ||
templateUrl: 'components/view2/view2.html', | ||
controller: 'MyCtrl2' | ||
}); | ||
}]) | ||
|
||
.controller('MyCtrl2', ['$scope', function($scope) { | ||
|
||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
/* jasmine specs for the view1 module go here */ | ||
|
||
describe('view1 module', function(){ | ||
var scope, ctrl; | ||
|
||
beforeEach(angular.mock.module('myApp')); | ||
|
||
beforeEach(inject(function($rootScope, $controller){ | ||
scope = $rootScope.$new(); | ||
ctrl = $controller('MyCtrl1', { $scope: scope }); | ||
})); | ||
|
||
it('should ....', function() { | ||
expect(ctrl).toBeDefined(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
/* jasmine specs for the view2 module go here */ | ||
|
||
describe('view2 module', function(){ | ||
var scope, ctrl; | ||
|
||
beforeEach(angular.mock.module('myApp')); | ||
|
||
beforeEach(inject(function($rootScope, $controller){ | ||
scope = $rootScope.$new(); | ||
ctrl = $controller('MyCtrl2', { $scope: scope }); | ||
})); | ||
|
||
it('should ....', function() { | ||
expect(ctrl).toBeDefined(); | ||
}); | ||
}); |