当前位置: 动力学知识库 > 问答 > 编程问答 >

angularjs - angular template cache doesn't work when template key contains file extension

问题描述:

Template cache fails for me for some reason, when I do this:

angular.module('myApp').run([

'$templateCache', function ($templateCache) {

$templateCache.put('test.html', 'content');

}

]);

and then when using routeProvider

$routeProvider.when("/my/url", {

templateUrl: 'test.html'

})

However, if I change my key from "test.html" to just "test", it works. For some reason, it fails soon as I add the file extension to the key.

分享给朋友:
您可能感兴趣的文章:
随机阅读: