Skip to content

Instantly share code, notes, and snippets.

@martinoss
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinoss/65310cc5258e25250e6e to your computer and use it in GitHub Desktop.
Save martinoss/65310cc5258e25250e6e to your computer and use it in GitHub Desktop.
Angular Starting Point
<body ng-app="myApp" class="container">
<div>
View:
<ui-view />
</div>
</body>
angular.module('myApp.orders', []);
angular.module('myApp.orders')
.config(function(/*info*/) {
//--> Would not work...
//console.log('orders config: ' + info.version);
});
angular.module('myApp', ['ui.router', 'myApp.orders']);
angular.module('myApp')
.constant('info', {
version : '1.0'
});
angular.module('myApp')
.config(function($stateProvider, $urlRouterProvider, info) {
$urlRouterProvider.otherwise('/');
console.log('app config: ' + info.version);
$stateProvider
.state('home', {
url : '/',
template : 'test',
controller : 'MyController'
});
});
angular.module('myApp.orders')
.controller('MyController', function (info) {
console.log('controller: ' + info.version);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment