我有以下代码:
<span ng-include="getHeaderTemplate()"></span>
getHeaderTemplate() 返回“模板/标题/prospection.html”
但是,我收到以下错误:
Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: templates/header/prospection.html
http://errors.angularjs.org/1.2.9/$sce/insecurl?p0=templates%2Fheader%2Fprospection.html
at http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:78:12
at Object.getTrusted (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:12739:17)
at Object.sceParseAsTrusted (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:13168:22)
at Scope.$digest (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:11800:40)
at Scope.$apply (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:12061:24)
at http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:1302:15
at Object.invoke (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:3710:17)
at doBootstrap (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:1300:14)
at bootstrap (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:1314:12)
at angularInit (http://localhost/piquick/laravel/public/vendor/angular-1.2.9.js:1263:5)
Url 在同一台服务器上(它是本地 URL),所以我不明白为什么会出现此错误。
这是关于 $sce 的文档
http://docs.angularjs.org/api/ng.$sce#resourceurlpatternitem