How to create a windows universal app with angularjs?
I created an universal windows app using visual studio, added the angular script (for testing purposes, I tried it on different ways with bower, manually and with nuget) and always get "Unable to add dynamic content".
Searching for this I found a lot of links trying to explain how to get around this error, for example: http://blog.kadople.com/2013/06/getting-started-with-angularjs-in.html. But it all seems to be very ugly or not working at all - at least not for windows universal apps. The demo app of the link mentioned is working but that involved hacking around in jquery code adding execUnsafeLocalFunction and that is something I really don't want to do. And I think this should be working with jquery version >= 2.0 - but ok, it is not.
How can we make this app "universal"? ;)
Windows Universal app development can be tricky, especially if you are using angularjs. As suggested by Sorskoot, winstore-jscompat is required to be able to use angularjs in your universal windows app.
I suggest using this fork of jscompat by AndyB that I found to be working with my test project.
Try adding
ng-csp
attribute to your Angularjs app as mentioned in their docs for windows universal apps https://docs.angularjs.org/api/ng/directive/ngCspYou are now two steps closer to making a "universal" windows app!
A great solution to this problem is to WinStore-JsCompat in your project. Just include it and add a reference in you .html file before all other scripts and you're good to go.