You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

22 lines
681 B
JavaScript

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