I have one html file and a controller assigned via $routeProvider
.when('/page/:pageId', {
templateUrl: 'xxxx.html',
controller: 'PageCtrl'
})
and in the controller.js file i am accessing the value of pageId using $routeParams
in 'PageCtrl' function.
pageId = $routeParams.pageId;
and in view the html is
<div ng-controller="headerController">
{{page.pageId}}
</div>
so in html i want to display the pageId, if pageId is passed in the url.
so here my question is once the pageId is passed its going correctly to the pageCtrl in Js and pageId
scope value assigned, and am also able to assign the same scope value to the second controller 'headerController' by $controller('headerController', {$scope: $scope});
able to see that scope value is getting updated from one controller to another controller but my problem is that scope value which is updated, unable to view in html ({{page.pageId}}
)