【发布时间】:2013-04-24 13:07:51
【问题描述】:
有没有办法检查给定的 url 是否已经存在于 AngularJS 的 $templateCache 中?
为了提供一些上下文:我做了一个指令,在等待加载 ngInclude templateUrl 时插入一个加载器,然后播放动画,如果内容只是从缓存而不是从服务器获取。
【问题讨论】:
标签: caching angularjs angularjs-ng-include
有没有办法检查给定的 url 是否已经存在于 AngularJS 的 $templateCache 中?
为了提供一些上下文:我做了一个指令,在等待加载 ngInclude templateUrl 时插入一个加载器,然后播放动画,如果内容只是从缓存而不是从服务器获取。
【问题讨论】:
标签: caching angularjs angularjs-ng-include
您可以使用下面的代码来检查 url 是否存在于模板缓存中
$templateCache.get('stringurl');
【讨论】: