Skip to content

Instantly share code, notes, and snippets.

@gaboesquivel
Last active December 23, 2015 09:19
Show Gist options
  • Save gaboesquivel/6613862 to your computer and use it in GitHub Desktop.
Save gaboesquivel/6613862 to your computer and use it in GitHub Desktop.
/**
* Each section of the site has its own module. It probably also has submodules
* For example, a `note` section could have the submodules `note.create`,
* `note.delete`, `note.edit`, etc.
*
* The dependencies block here is also where component dependencies should be
* specified, as shown below.
*/
angular.module( 'ngBoilerplate.home', [
'ui.state',
'titleService',
'plusOne'
])
/**
* Each section or module of the site can also have its own routes. AngularJS
* will handle ensuring they are all available at run-time, but splitting it
* this way makes each module more "self-contained".
*/
.config(function config( $stateProvider ) {
$stateProvider.state( 'home', {
url: '/home',
views: {
"main": {
controller: 'HomeCtrl',
templateUrl: 'home/home.tpl.html'
}
}
});
})
/**
* And of course we define a controller for our route.
*/
.controller( 'HomeCtrl', function HomeController( $scope, titleService ) {
titleService.setTitle( 'Home' );
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment