I have a SPA in Extjs system. I have also included angular and the necessary modules which i want to use on a page (external html referred in a panel of extjs).
Angular is defined in and working everywhere except in newly loaded page.The problem is that i have to (re)load angular on each page-load in order to get my page recognized by angular. If i load it each time, everythink works.
How can i ensure that my dynamically page is recognized automatically by angular?
My html:
<div ng-controller="MainCtrl">
{{3+3}} and {{n}} <br>
</div>
angular.bootstrap()
was the solution.Things you have to care about are:
you can put the bootstrap in a panel's afterrender like:
listeners : { 'afterrender' : { fn : function (panel, par2, par3) { angular.bootstrap($('#idOfYourAngularCode'), ['A']); }, scope : this } }