my base domain is http://www.netroby.com

and the static resources domain was http://s-www.netroby.com


when i try to load resource from the static domain.

It show me :

http://www.netroby.com/http://s-www.netroby.com/#/a/index.origin.html not 
found


The problem is, angular js should not append the base domain by default.

Why not leave the templateUrl as it was.

http://s-www.netroby.com/#/a/index.origin.html  this is a valid url , and 
the file exists.

but this one:

http://www.netroby.com/http://s-www.netroby.com/#/a/index.origin.html

not a valid url


zixu mo於 2014年12月22日星期一UTC+8上午10時49分45秒寫道:
>
> 'use strict';
>
> var adminApp = angular.module('deyihome-admin', [
>    'ngRoute',
>     'adminControllers'
> ]);
>
> adminApp.config(['$routeProvider', '$sceDelegateProvider',
>     function($routeProvider, $sceDelegateProvider) {
>         var newhost = 's-'+top.location.host;
>         console.log(newhost);
>         var static_prefix = top.location.protocol+'://'+newhost;
>         console.log(static_prefix);
>         $sceDelegateProvider.resourceUrlWhitelist([
>             'self',
>             'http://*.netroby.com/**',
>             'https://*.netroby.com/**'
>         ]);
>         $routeProvider.
>             when('/home', {
>               templateUrl:static_prefix+'/a/index.origin.html',
>                 controller:'home'
>             }).
>             when('/s-contractor', {
>             templateUrl: static_prefix+'/a/s-contractor.html',
>             controller: 's-contractor'
>         });
>     }
> ]);
>
>
> I want load template from third party domain. 
> but it now working.
>
> How can i do like this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to