I want to execute a function after the view gets loaded/ after entering to that view.
My directory is as follows:
app.directive('bonFormViewerFrame', function ($formStore) {
return {
restrict: 'E', //bind to element tag name
replace: true, //replace the entire markup with the template
templateUrl: 'ui/controls/bon-form-viewer-frame.html',
scope: {
form: '=' //specifies the item to be displayed.
},
controller: ['$scope', function ($scope) {
$scope.formContent = ($scope.form != null) ? $scope.form.Content : "";
$scope.$on("$ionicView.beforeEnter", function (event, data) {
// handle event
console.log("State Params: ", data.stateParams);
});
$scope.$on("$ionicView.enter", function (event, data) {
// handle event
console.log("State Params: ", data.stateParams);
});
$scope.$on("$ionicView.afterEnter", function (event, data) {
// handle event
console.log("State Params: ", data.stateParams);
});
}]
};
});
None of the above $ionicView
events are firing. Can anyone help me out? Or what i'm doing wrong here?