winjs / angular-winjs

Project to smooth the AngularJS/WinJS interaction
Other
126 stars 46 forks source link

_setImmediate is undefined in WinJS 2.1 #62

Closed gabmontes closed 8 years ago

gabmontes commented 9 years ago

In js/angular-winjs.js#L158, there is a call to WinJS.Utilities._setImmediate but _setImmediate is undefined for WinJS 2.1 as found embedded in WP 8.1. The function setImmediate is defined in IE's global scope and should be used as fallback.

AmazingJaze commented 8 years ago

Hi @gabmontes, thank you for raising this for discussion. Each release of the angular-winjs bridge is tied to a very specific release of WinJS. We release a new angular-winjs bridge to correspond with each new version of WinJS but that is the only version of WinJS that that particular angular-winjs bridge is supported for. You can see the angular-winjs change log in this repo's wiki for a mapping about which version of WinJS the bridge has been updated to support, but I don't believe we will be servicing any fixes to address older versions of WinJS at this time.

gabmontes commented 8 years ago

@AmazingJaze thanks for the insight. That sounds reasonable and I'm ok with that. In fact, the solution I found was to patch WinJS instead:

WinJS.UI.Command = WinJS.UI.AppBarCommand;
WinJS.Utilities._setImmediate = setImmediate.bind(window);

Complete patch at: https://gist.github.com/gabmontes/6a65551c6155f6775ecd

As far as I can tell, angular-winjs 3.1.1 works fine with WinJS 2.1 and this patch. Thanks again!