| 'use strict'; | |
| var app; | |
| app = angular.module('blogApp', ['ngRoute', 'blogControllers']).config([ | |
| '$routeProvider', function($routeProvider) { | |
| return $routeProvider.when('/posts', { | |
| title: 'Home', | |
| templateUrl: 'partials/posts-homepage.html', | |
| controller: 'homePageCtrl' | |
| }).when('/post/:id', { | |
| title: 'Post', | |
| templateUrl: 'partials/posts-view.html', | |
| controller: 'postviewCtrl' | |
| }).otherwise({ | |
| redirectTo: '/posts' | |
| }); | |
| } | |
| ]).run([ | |
| '$location', '$rootScope', function($location, $rootScope) { | |
| $rootScope.title = 'Home'; | |
| return $rootScope.$on('$routeChangeSuccess', function(event, current, previous) { | |
| return $rootScope.title = current.$$route.title; | |
| }); | |
| } | |
| ]); | |
| //# sourceMappingURL=app.js.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment