Is it possible to change templateUrl on the fly by passing values in the directive\'s scope? I want to pass data to controller that will render the page based on the data th
I had similar problem
return {
restrict: 'AE',
templateUrl: function(elm,attrs){return (attrs.scrolled='scrolled' ?'parts/scrolledNav.php':'parts/nav.php')},
replace: true,
partnersSite.directive('navMenu', function () {
return {
restrict: 'AE',
templateUrl: function(elm,attrs){return (attrs.scrolled='scrolled' ?'parts/scrolledNav.php':'parts/nav.php')},
replace: true,
link: function (scope, elm, attrs) {
scope.hidden = true;
//other logics
}
};
});