Saturday 15 May 2010

angularjs - Windows 8 and href -



angularjs - Windows 8 and href -

i trying convert angularjs web app multi device app.

on web application used ngroute. this

app.config(['$routeprovider',function ($routeprovider) { $routeprovider .when('/home', { controller: 'homectr', templateurl: '/scripts/app/modules/home/home.html' })

}]);

and in index html page simple href , ngview below:

<a ng-href="#/home">go home</a> <div data-ng-view=""> </div>

if run application in ripple android works charm, on windows or windows arm doesn't work @ all! seems doesn't know how interpret # on link.

how can solve it?

thanks!

i figured out post , article well!

basically problem when app published win app, href rendered prefix 'unsafe:ms-appx'.

to allow works correctly, plenty add together config

app.config(['$compileprovider', function ($compileprovider) { $compileprovider.ahrefsanitizationwhitelist(/^\s*(https?|ftp|mailto|file|ghttps?|ms-appx|x-wmapp0):/);}]);

also, maintain in mind when configure templateurl on $routeprovider, cannot start url "/" if want application works fine in windows (i used set template url "/app/views/myview.html" sure path starts root, but approach seems not working windows app).

thanks!

angularjs windows-store-apps multi-device-hybrid-apps ngroute

No comments:

Post a Comment