image - WindowsPhone 8 and AngularJs - ng-src not working? -
im trying run (phonegap / angular) app on windows phone emulator. works fine images not displayed. figured out ng-src troublemaker. when im using src instead of ng-src local images in same folder - works fine.
here examples:
dispalyed:
<img ng-click="mediaplay()" ng-hide=showbutton() src="img/go.png" style="float: right">
not displayed:
<img ng-src="img/{{poi.poiimage}}" style="display: block; margin: 0 auto">
my app works perfect on android , ios.
any ideas how fix this?
edit*
ok getting weird o0... i've putted "img/{{poi.poiimage}}" in p tag , gives me path: img/poi-12-galgentor-01.png
so tried src:
<img src="img/12-galgentor-01.png" style="display: block; margin: 0 auto">
and ng-src:
<img ng-src="img/12-galgentor-01.png" style="display: block; margin: 0 auto">
both worked me!
but this...
<img ng-src="img/{{poi.poiimage}}" style="display: block; margin: 0 auto"> <img src="img/{{poi.poiimage}}" style="display: block; margin: 0 auto">
does not work.
edit2*
tested in emulators browser ... works fine too. -.-
this not solution per se: angularjs broken on wp8 devices.
no not...
i got it:
it problem old ie's , windows phones. srcurls have whitelistet. otherwhise angular generates "unsafe:" prefix on every src url. can fixed changing angular apps config below:
schreibwerkapp.config(['$routeprovider', '$compileprovider', function ($routeprovider, $compileprovider) { $compileprovider.imgsrcsanitizationwhitelist('img/'); $routeprovider. when('/splash', { templateurl: 'partials/splash.html' }). when('/terms', { templateurl: 'partials/terms.html' }). when('/intro', { templateurl: 'partials/intro.html' }). when('/poi/:stationid', { templateurl: 'partials/poi.html', controller: 'poictrl' }). when('/directive', { templateurl: 'partials/directive.html' }). when('/imgview/:stationid/:imgid', { templateurl: 'partials/imgview.html', controller: 'imgctrl' }). otherwise({ redirectto: '/splash' }); }]);
Comments
Post a Comment