angularjs - Failed to load resource error when debugging Cordova app on device -


the resource html view should injected index.html using angular's nginclude.

this works in ripple, not when trying debug on android device (or device emulator).

i using vs2013 cordova project.

the exact error reported in visual studio javascript console is:

failed load resource
file: test.html, line: 0, column: 0

my nginclude div looks like:

<div ng-include="'/views/test.html'"></div>  

and test.html simple:

<div>   <h3>my template content!</h3> </div> 

again, work in ripple, not on device. i'm not sure additional details why might failing.

the way include resource works in browser environments application loaded root context /.

in android , ios resources of webview have "longer" urls.

changing

<div ng-include="'/views/test.html'"></div>  

into

<div ng-include="'views/test.html'"></div> 

should solve problem.


Comments