javascript - Automatically bootstrap Angular app injected into web app -


I want to use angular within an existing non-kernel webpage, the app is injected into the page and a special device I want to bind in Since the app may need several corner apps to be bound to the various legends (showing and hiding as needed), it seems that I can not use NGP and manual bootstrapping should be done. However, it needs to do something ugly as below, where I have to define a booststop function, which I call from the app I inject the Conakrer app. Is there any way to avoid calling DoBootstrap in this scenario? I basically want to start the injection and app automatically. This does not happen on initial load, hence the document. Style solutions are not an option. Also, it would be great to avoid defining the NG-controller on the div, but it is a low problem.

  angular.module ('TestApp', []). Controller ('TestAppController', ['$ scope', function ($ scope) {document.getElementById ('myDiv'). InnerText = 'test';}]); Var doBootstrap = function () {angular.bootstrap (document.getElementById ('myDiv'), ['TestApp']); };    

How about:

  angular Element (document) .ready (function () {angular.bootstrap (document, ['TestApp']);});   

Also see this documentation:

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -