ng-inspector icon indicating copy to clipboard operation
ng-inspector copied to clipboard

Manual bootstrapping from the same file that bundles angular

Open rev087 opened this issue 10 years ago • 3 comments
trafficstars

Create a test with manual bootstrap done in the same file that bundles angular itself.

rev087 avatar May 07 '15 22:05 rev087

Is this something that you already know works, and just want a test to guard against it, or are you actually looking to verify whether we handle this case?

DrewML avatar May 24 '15 02:05 DrewML

I havent tested it, but it almost certainly won't work, so maybe just writing a test would be silly. I wrote this issue quickly diring the last meeting.

rev087 avatar May 24 '15 08:05 rev087

I have a theory for how we could address this. We'd basically need to change our mechanism we use for capturing angular's bootstrap method.

Instead of using mutation observers to listen for scripts being appended to the page, we could just configure window.angular to be a getter/setter. In that scenario, when the Angular lib loads and tries to assign to window.angular, our setter would catch it, swap the bootstrap method (as we do now), and then store a reference to the original angular object, that can be exposed through the getter.

I may hack up an example at some point just to play around with, and see if there are any obvious gotchas I'm not considering.

DrewML avatar Sep 28 '15 15:09 DrewML