WinJS with AngularJS

I have a lot of angularjs code (written by a colleague) and I'm trying to assess how much of it is re-usable in a Windows 8 Metro (or whatever they decide to rename it) app.

Does anyone know how well angularjs gels with WinJS?

As Windows 8 is still very new and there might not be too many people out there (if any) that have tried using angular to build a Windows 8 app, does anyone have experience trying to use angular with some other framework that requires specific proprietary html attributes (like maybe a Yahoo Connected TV app).

My main concern is that the WinJS proprietary html attributes won't get picked up and acted on properly when content is dynamically inserted into the DOM via angular but I have no idea.

I'm still waiting for my Windows dev box to arrive so I'm just doing research now. If it turns up before anyone answers I'll circle back and share my results.

Its just a normal HTML platform, which is the same as IE10 interms of capability. There are restrictions on certain direct setting of innerHTML etc, which much pass through toStaticHTML first. However, this can be can worked around.

Note, it's not required to use WinJS to write a HTML5 Win8 application.

The WinJS.Binding namespace does a lot of what AngularJS does. It uses the data- attributes similar to AngularJS, so it might not be too hard to port the templates from AngularJS to WinJS, although a lot of the backend JavaScript might have to change.

Check out this library: https://github.com/codemonkeychris/angular-winjs, it helps you use WinJS UI controls with AngularJS. In the test app readme it talks about what you need to do to get Angular up and running in the Windows 8 enviornment.

This blog (http://onehungrymind.com/windows-8-and-angularjs/) appears to solve this problem, though I think there may be side-effects that still have to be worked through.

While we can use Angular with WinJS seamlessly (except the little jquery and appendto issue), the key would be how to use winJS controls within angularJS. I believe we will end up writing directives for using WinJS controls in angular project (like typically we do for jquery widgets). In my mind we need to use winjs controls as they follow win8 standards and look and feel. Other question would be which navigation framework to use - and I think the answer would be angularJS because of it's simplicity and power:) On the other hand WinJS have rich indexedDB, localstorage capabilities in built which probably we can re-use in angular. In short, I see both can work together as complimentary to each other.