Javascript not accessible from inside Angular ui-view

前端 未结 7 1559
执念已碎
执念已碎 2021-01-18 17:56

I have a main template (index.html) with an Angular ui-view. Inside this main template I import a bunch of Javascript files. I expect these files to be available to the cont

7条回答
  •  情话喂你
    2021-01-18 18:55

    This is a super late response, but I ran into this same exact issue myself. I have solved this by including the external js libraries before including Angular and Angular UI Router.

    Just like the OP, my project consisted of an index.html as well as a ui-view. The partials load into the ui-view properly, but the external js libraries do not take effect inside the partial via ui-view. If the contents from the partial are placed into the index.html, everything works perfectly.

    Scripts changed from

    
    
    
    
    
    
      
    

    Scripts changed to

    
    
    
    
    
    
     
    

    Final Outcome and working

    
    
    
        
    
    
    
    
        

提交回复
热议问题