1

I have an existing angular / phonegap app that I'm trying to port to a windows metro app for win8. I've replaced my jQuery with a metro specific version and I've wrapped each angular module in the MSAp.execUnsafeLocalFunction method and I'm getting the application to sort of compile.

What is happening is that the page is built using angular ui router, so I'm able to see the dynamically created page, with angular ui router combining the 3 or 4 partials based on the route. However, when Angular starts to go through ng-bind, ng-repeat, etc... I'm getting the following error, "JavaScript runtime error: Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, the might be unsafe..."

I've looked to see how others have overcome this issue, but I have not found anything that works. I'm worried that what I'm doing is going to have force me to rewrite the application using the WinJS library.

Does anyone have any resources or experience that can help me with this?

Will Haley
  • 265
  • 1
  • 9

1 Answers1

1

What works for me is adding the ng-csp directive to the HTML tag. This disables some of the dynamic content stuff of Angular. I didn't even wrap anything in exeUnsafeLocaFunction. I'm not sure if it will work on Angular UI Router though...

More on the ng-csp directive here...

Sorskoot
  • 10,190
  • 6
  • 55
  • 98
  • Thanks and I did forget to try that. Unfortunately it doesn't seem to help. I'm pretty sure the issue isn't angular, it is the WinJS object preventing angular from doing it's thing... I think. – Will Haley Sep 16 '14 at 15:17