All,
The AngularJS framework has been recommended as an MVC framework for developing Chrome Packaged Apps.
However, Chrome Packaged Apps either cannot do "dangerous" things (like eval, setTimeout, setInterval) in the root container and they cannot send XmlHttpRequests from a sandbox. From what I can gather, the recommended approach is to place applications that (may) need both in a sandbox and to perform XmlHttpRequests indirectly, by messaging the container and having it do the XmlHttpRequests.
We've been able to refactor our AngularJS application so that our explicit XmlHttpRequests are done indirectly, through messaging from the sandbox application to the container application. However, there are some implicit (to us) XmlHttpRequests being made by the routeProviderModule, which I'm guessing are being delegated to the AngularJS $http service (
http://docs.angularjs.org/api/ng.$http), which is then issuing the XmlHttpRequests. Some angular.js source code exploration has lead me to believe this.
Here's a representative error that I see in the sandbox part of the application:
And here's part of how we're configuring the route provider:
angular.module('routeProviderModule', []).config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/SomePath', {templateUrl: 'path/to/some/page.html'});
}]);
Is there a way to configure AngularJS so that resources will be loaded "locally" within a sandbox, rather than through HTTP (and specifically through XmlHttpRequests)?
Thanks in advance for any advice and/or guidance.
Cheers