Last active
December 23, 2015 09:19
-
-
Save gaboesquivel/6613862 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* 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