当我这样做时,由于某种原因,模板缓存对我来说失败了:
angular.module('myApp').run([
'$templateCache', function ($templateCache) {
$templateCache.put('test.html', 'content');
}
]);
然后在使用 routeProvider 时
$routeProvider.when("/my/url", {
templateUrl: 'test.html'
})
但是,如果我将密钥从“test.html”更改为“test”,它就可以工作。出于某种原因,当我将文件扩展名添加到密钥时,它很快就会失败。