我想在每次ng-include
指令請求一個部分時更改url。到目前爲止,我能看到的網址,而該事件是這樣的:
app.run(function ($rootScope) {
$rootScope.$on('$includeContentRequested', function (event, url) {
console.log(event);
console.log(url);
});
});
現在我需要能夠將URL從'templates/incs/includedPartial.html'
改變'templates/incs/includedPartial.html?cache_version=1_1'
,然後包括部分新鏈接。
顯然我這樣做是爲了防止版本更改時出現緩存問題。這是一個好策略還是有更好的解決方案?在此先感謝您的幫助...