I'm trying to add a component instead of a directive but it doesn't work. my directive:
(function() {
'use strict';
angular.
module('eventeditor')
.directive("displayTab",
function() {
return({
templateUrl: function(elem, attr){
if(attr.tabname === 'details') return "/organizer/fragments/detailsform.html";
}
});
}
);
})();
Component style:
(function() {
'use strict';
angular.
module('eventeditor')
.component("displayTab", {
templateUrl: function($element, $attrs) {
if ($attrs.tabname === 'details') return "/organizer/fragments/detailsform.html";
}
});
})();
What am I doing wrong? I use my template like:
<div ng-switch="nav.getTab()">
<div ng-switch-when="details" display-tab="" tabname="details">details</div>
</div>