AngularJS Bootstraps Navbar

前端 未结 1 1247
时光说笑
时光说笑 2021-01-14 10:19

I\'m trying to have a bootstraps navbar display and remove html elements defendant on data from an angular controller.

I have the following jade code:



        
相关标签:
1条回答
  • 2021-01-14 11:07

    When Angular $scope properties are changed "outside" of Angular, $scope.$apply() needs to be called to cause Angular to enter its digest loop. Any properties that are projected onto the current view will have $watches, which the digest loop will evaluate. When a change is detected in one of these $watches, the view is updated.

    Examples of "outside" of Angular:

    • Browser event callback. E.g.,
      element.bind('someEvent', function() {
          //need to call scope.$apply in here
      })
    • Third-party plugin callback. E.g., the callback passed to logout above.
    • Third-party AJAX callback.
    • Third-party promise.
    0 讨论(0)
提交回复
热议问题