I need to display profile details of a user using a view call defined as:
.state('app.user', {
url: "/user/:userId",
views: {
'menuContent': {
templateUrl: "templates/user.html",
controller: 'UserCtrl'
}
}
})
Since Ionic cache the $scope I need to reload data of the user every time I enter in app.user state so that I’m using $scope.$on(’$ionicView.enter’, function (event, state) { … } to detect the event.
I discovered I have all the info of current $scope in event.targetScope
and my userId
param in state.stateParams.userId
, but if I try to change them nothing happen in the view and if I try to call an $apply I get the $digest error.
I saw that there was a bug on this so that now I have the 1.0.0-rc.4 version, but I still I can’t solve my problem.
Thanks