Last post Mar 13, 2016 05:09 PM by mansoor_ali_uk
Mar 12, 2016 06:55 PM|mansoor_ali_uk|LINK
I use angular js in my application and I want to manage page titles similar like ViewData["title"] in MVC 6, I have 1 master view Index and several partial views as child pages of index.
Mar 13, 2016 05:36 AM|Khuram.Shahzad|LINK
//Mange event on app level
//Whenever route change successfully this code executed
//Validate route exisit and then set page title
//Title property get from route config
app.run(['$location', '$rootScope', function ($location, $rootScope)
$rootScope.$on('$routeChangeSuccess', function (event, current, previous)
$rootScope.title = current.$$route.title;
here my application scope var is "app" maybe yours different so use it accordingly
The code above take title parameter from route config and update the title of page whenever route has been changed
//title is custom property set here and get in main page
title:'Used Cars :: Search'
Mar 13, 2016 05:09 PM|mansoor_ali_uk|LINK
I think you don't need $location parameter in app.run block..
Its working, thanks