Angular Directive Different Template
I have a directive myDirective with variable type. If I run <my-directive type="X"> I want the directive to use templateUrl: x-template.html. If I do <my-directive type="Y"> I want the directive to use templateUrl: y-template.html. This is my current directive. app.directive('myDirective', function() { var myDirective = { templateUrl: 'X-template.html', restrict: 'E', scope: { type: '=' }, }; return myDirective; }); I read thru stackoverflow and angular documentation but have not found anything that I need. I am now trying to do something along the lines of: if ($scope.type === 'X') {