0
因为每一个局部模板缓存,我不,不想我这样做AngularJs覆盖templateUrl功能
.directive('myMessages', [ function() {
return {
restrict : 'E',
templateUrl : 'wwwroot/base/messages/ui.partial.messages.show.html?v' + Date.now(),
,才有可能在全球范围覆盖templateUrl
功能,并在末尾添加日期?
我也尝试从论坛这两种解决方案,但他们永远不会触发:
$rootScope.$on('$routeChangeStart', function(event, next, current) {
$templateCache.remove(current.templateUrl);
});
$rootScope.$on('$viewContentLoaded', function() {
$templateCache.removeAll();
});
[与UI的路由器AngularJS禁用模板缓存](http://stackoverflow.com/questions/23589843/disable-template-caching-in-angularjs-with-ui-router) –
的可能的复制你把那些代码放在哪里?我在我的app.run函数中或多或少地做了同样的事情,并且它可以正常工作,每次运行视图时都会加载它。 –