Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
angularjs 1 and ng-if, ng-show, ng-hide not firing
-
Hi all,
Recently started developing in onsen & ang1 and having issues with ng-if functions not being fired after initial page load.- There is an ng-app on the index.html
- then I load my main interface with ng-controller and ons-navigator & tabs
- the ons-pages that get loaded into the main interface have their own ng-controllers and their ng-if type attributes are never fired again after initial page load.
I have tried
*ng-controller=“xxxController” *-> ng-if=“variable” with $scope.variable, ng-if=“someObject.variable” with $scope.someObject.variable ,
also
*ng-controller=“xxxController as page” * -> ng-if=“page.variable” with this.variable, ng-if=“page.someObject.variable” with this.someObject.variable
but any change in the connected ‘ng-if/show/hide’ variable after page init is ignored… changes show in controller.Anybody had similar issues??
Regards,
Bleeksie
-
This post is deleted!
-
thought I had it solved by adding the ons-scope but still oddly not doing what is expected.
-
This is using
ons.bootstrap
instead of normalangular.module
, but if should be equivalent if you are doing it correctly: https://codepen.io/frankdiox/pen/KXORKQ