1 /* http://docs.angularjs.org/#!angular.service */
4 * App service which is responsible for the main configuration of the app.
6 angular.service('myAngularApp', function($route, $location, $window) {
8 $route.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
9 $route.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
11 $route.onChange(function() {
12 if ($location.hash === '') {
13 $location.updateHash('/view1');
16 $route.current.scope.params = $route.current.params;
17 $window.scrollTo(0,0);
21 }, {$inject:['$route', '$location', '$window'], $creation: 'eager'});