In my angular application, I have several instances $modalthat are created as:
var modalInstance = $modal.open({
templateUrl: APP_CONFIG.TPL_PATH + '/path/template.html',
controller: 'TemplateController'
});
The problem is that after viewing these modals, they are cached, and if I change them, I have to clear my browsers cache. Not a problem on the dev machine, but a problem when I provided this application to potential users.
I found them as "solutions":
$rootScope.$on('$stateChangeStart', function(event, next, current) {
$templateCache.remove(current.templateUrl);
});
$rootScope.$on('$viewContentLoaded', function() {
$templateCache.removeAll();
});
$modal.open({
templateUrl: '/app/components/your-modal.html?bust=' + Math.random().toString(36).slice(2),
controller: 'YourModalController'
});
Are there any sufficient solutions? Thank you in advance.
EDIT
, , .js ( <p>Data</p> <p>{{data}}</p> $scope.data = 'Data' .js). , . , .js ? ( ), (, <p>{{data}}</p><img src='{{imageUrl}}>')?