angularjs - ui-router: update parent from a child -
i have question ui-router , architecture.
what best way update parent template or this?
if have 2 states:
$stateprovider .state('layout', { controller: 'layoutctrl layout', templateurl: 'app/layout/templates/layout.html' }) .state('layout.page', { controller: 'pagecontroller page', templateurl: 'app/page/templates/page.html' }); and template layout.html:
<header> <h2>{{ layout.title }}</h2> </header> <ui-view></ui-view> <footer> <!-- content --> </footer> how can set page title (layout.title) ?
or have problem specific page. on page have fixed layout header. how can make fixed layout header? have directive named sticky, best way tell parent state set directive header?
i'm using $scope.$emit , $scope.$on i'm not sure correct way. thank you.
i use $rootscope attribute handle page title , modify in underlying controllers.
Comments
Post a Comment