Update seed app
parent
93599abf49
commit
5da17aa54c
@ -1,17 +1,10 @@
|
||||
'use strict';
|
||||
/* http://docs.angularjs.org/#!angular.service */
|
||||
|
||||
// Declare app level module which depends on filters, and services
|
||||
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.widgets']).
|
||||
run(['$route', '$window', '$rootScope', function($route, $window, $rootScope) {
|
||||
|
||||
$route.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
|
||||
$route.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
|
||||
$route.otherwise({redirectTo: '/view1'});
|
||||
|
||||
var self = this;
|
||||
|
||||
$rootScope.$on('$afterRouteChange', function(){
|
||||
$window.scrollTo(0,0);
|
||||
});
|
||||
// Declare app level module which depends on filters, and services
|
||||
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']).
|
||||
config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
|
||||
$routeProvider.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
|
||||
$routeProvider.otherwise({redirectTo: '/view1'});
|
||||
}]);
|
||||
|
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
/* http://docs-next.angularjs.org/api/angular.module.ng.$compileProvider.directive */
|
||||
|
||||
|
||||
angular.module('myApp.directives', []).
|
||||
directive('appVersion', ['version', function(version) {
|
||||
return function(scope, elm, attrs) {
|
||||
elm.text(version);
|
||||
};
|
||||
}]);
|
@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
/* http://docs.angularjs.org/#!angular.widget */
|
||||
|
||||
angular.module('myApp.widgets', [], function() {
|
||||
// temporary hack until we have proper directive injection.
|
||||
angular.directive('app-version', function() {
|
||||
return ['version', '$element', function(version, element) {
|
||||
element.text(version);
|
||||
}];
|
||||
});
|
||||
});
|
Reference in New Issue