New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
angularjs ng-view can't load template #1314
Comments
I'm using Angular views with NW and never had any problem. |
I apologize for my slow response.. For the sake of example-rule, I will attach myApp example, that contains minimum angularjs code. https://www.dropbox.com/s/wn4onu602w0kt9q/myApp.zip My environment:
After you extract it.. Try running it as default, in commandline:
I think it's weird for me. And hard to manage views via script tag, rather than separate location as file. |
I summon both of you. And I apologize for my slow response |
Indeed it doesn't work. I'm using The problem actually affects app.controller('indexCtrl', function ($scope, $http) {
$scope.hello = 'Hello world';
$http.get("/app/views/v1.html").then(function (response) {
// success event should fire....
console.log('$http ok');
console.log(response);
}, function (err) {
// ...but error will fire instead
console.log('$http error');
console.log(err);
});
}); In angular function isSuccess(status) {
return 200 <= status && status < 300;
} XMLHttpRequest is returning status code 0 (zero), when used with Solution is simple: XMLHttpRequest in node-webkit should return status code 200 instead of 0 when used with Please reopen this issue. |
Hmm okay Should we mention angular developer here? Or just create new issue there and link this issue? |
This issue should be resolved on node-webkit side. Angular is standards compliant, node-webkit is not (returns invalid status code). |
Is angular supports app:// protocol or not? I just want use app protocol not file protocol, actually. What should I do? |
app:// protocol can be found only in node-webkit, and was born to easily port websites into desktop apps. Angular doesn't even know such thing as app:// exist. You should wait for patch in NW. |
It turns out you can also easily patch your local // fix status code for file protocol (it's always 0)
status = (protocol == 'file' && status === 0) ? (response ? 200 : 404) : status; And change it to: // fix status code for file protocol (it's always 0)
status = ((protocol == 'file' || protocol == 'app') && status === 0) ? (response ? 200 : 404) : status; Although this is really simple to fix in angular I will repeat: app:// protocol is internal to NW, and nothing except NW should know about its existance. |
Ok thanks. That is maybe the only solution. 👍 But, I think Angular.js team should know about this. Because for future use It's important, that html5+js technology is moving forward, never backward. |
Oh okay, now, I know that this is not angular problem. I apologize my previous comment. This issue happens because chrome not allowing xmlhttprequest from other protocol except http. @rogerwang should read this. |
thanks for reporting. I'll fix it. |
👍
@rogerwang do we have an estimate on when this can be fixed? Otherwise feel free to let us know where to modify the response status to do a PR if protocol is app:// |
I'll try to fix this in next version |
❤️ ❤️ ❤️ |
Fix #1314 Conflicts: src/net/app_protocol_handler.cc
This actually happen on 0.11.0, How I fix it? |
I fix this with this code:
For more information about this, read : https://docs.angularjs.org/api/ng/provider/$compileProvider :) |
When I use angularjs, with templateUrl in routeprovider, it can't load the template into view, but I checked the logs, the xmlhttprequest to template is serves as well. Why this happens?
The text was updated successfully, but these errors were encountered: