2

I have an AngularJS modal that works within an app that has been built using BackboneJS. The header of the page is built by the Backbone code. There is a button in this header, which when clicked opens up the angular modal.

Unfortunately, the button itself is added to the header after the DOM loads, so angular has already finished bootstrapping. Owing to this, the ng-click directive that has been attached to the button in the header, is not recognized by angular.

How do I make sure angular knows that changes have been made to the DOM? Is there a way to bootstrap angular any time I anticipate changes to the DOM from outside angular?

punkx2wibe
  • 21
  • 1
  • The angularjs documentation on bootstrapping might be helpful: https://docs.angularjs.org/guide/bootstrap – pje Nov 18 '14 at 21:33

1 Answers1

0

look at AngularJS How to dynamically add HTML and bind to controller specifically on: $compile(htmlcontent.contents())($scope); which does the connection. personally however, if you have angularjs, i would dump backbone. gives no added value.

Community
  • 1
  • 1
sagie
  • 1,744
  • 14
  • 15