angularjs - Angular controller not working on ion-nav-view -


i'm starting learn angular + ionic, pardon potential ignorance :)

after, following sample ionic's website i'm trying expand upon assigning ng-controller ion-nav-view. i'd use can listen $ionicview.enter on child views @ 1 time, instead of having separately inside of each child controller.

i add controller so:

<ion-nav-bar class="bar-positive">   <ion-nav-back-button>   </ion-nav-back-button> </ion-nav-bar>  <ion-nav-view ng-controller="navviewcontroller"></ion-nav-view> 

but never executes controller's constructor. if move assignment of ng-controller level (e.g. body element), works fine. there reason why wouldn't work when assigned onto ion-nav-view directly?

edit

here's codepen (trying figure out why navviewcontroller isn't getting called):

http://codepen.io/anon/pen/wxyykn

try answer. sorry didn't researched enough , misunderstood article read.


Comments