Whenever innerHTML
is changed the browser has to recreate the DOM tree. That means that all information associated with the existing DOM elements is lost.
This does not only include event listeners. Angular stores scopes and controllers on DOM elements. So basically the application is gone.
If the third party app really changes the innerHTML
of the body element, then you better let it run before angular.
As an alternative you can initialize the application manually and don't use the ng-app
. The details can be found in here