When working within a factory service, I have to use
$http.get(url, { cache: true })
Within my view, I utilize ng-if or ng-show to initiate a CSS transition.
The issue :
While it works perfectly for the initial request, subsequent requests of the same service function do not re-trigger the animation.
Is there a method to reset / retrigger the ng-if / ng-show animation ?
(The cache is necessary to avoid waiting time, but I still require the opacity animation to be triggered when transitioning between different states).
Thank you !
app.factory('progService', function ($http) {
var progService= {};
progService.getProgram = function() {
return $http.get(appInfo.api_url + 'pages/5', { cache: true});
};
return progService;
});
app.controller('programController', function($scope, progService) {
progService.getProgram().then(function(res){
$scope.program = res.data;
});
});
<div ng-if="program.aJsonKey"></div>