Monaca Onsen UI Discord Chat Github Repo

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 ,
    *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??


  • This post is deleted!

  • thought I had it solved by adding the ons-scope but still oddly not doing what is expected.

  • Onsen UI

    This is using ons.bootstrap instead of normal angular.module, but if should be equivalent if you are doing it correctly: