AngularJS update Meta title description from controller dynamically
app.config(
function($routeProvider, $locationProvider, ngMetaProvider){
$routeProvider.
when('/',{
templateUrl:'js/partials/s1.html',
controller:'HomeController',
meta: {
title: 'title1',
description: 'description12'
}
}).
when('/:id/:id', {
templateUrl: 'js/partials/site2.html',
controller: 'SinglePostController',
meta: {
title: 'title2',
description: 'description2'
}
}).
otherwise({
redirectTo:'/',
controller:'HomeController',
templateUrl:'js/partials/home.html'
});
$locationProvider.html5Mode(true);//.hashPrefix('!');
});
the above code is my config, i want to update the
meta: {
title: 'title2',
description: 'descrtion2'
}
how to update the title and description from the respective controller, any help