This is an example of my code where I want to switch a templateUrl. This works only if you refresh the page while holding the data in localstorage or backend.
app.directive('myPanel', ['myService', function(myService) {
if(myService.isThisTrue()) {
return {
restrict: 'E',
templateUrl: '/views/isTrue.html'
}
} else {
return {
restrict: 'E',
templateUrl: '/views/isFalse.html'
}
}
}]);
I did not find a decent way yet to do it better. Does anyone have a better solution?