Hi, I have two views in my application with two controllers assigned to each. Here I need to reinitialize the controller every time I switch to a specific view.
Angular Script:
.state('app.pnrlist', { url: "/pnrlist", views: { 'menuContent': { templateUrl: "templates/test.html", controller: "testControl", reload: true } }, reload:true }) .state('app.home', { url: "/home", views: { 'menuContent': { templateUrl: "templates/home.html", controller:"homeControl", reload:true } }, reload:true })
HTML content
<ion-content> <ion-list> <ion-item nav-clear menu-close href="#/app/home"> Home </ion-item> <ion-item nav-clear menu-close href="#/app/pnrlist"> PNR List </ion-item> </ion-list> </ion-content>
I tried to implement many solutions on the stack, but none of them helped me. The solution worked 1 / The solution was tried 2
source share