contacts/js/components/detailsItem/detailsItem_directive.js

21 lines
454 B
JavaScript
Raw Normal View History

angular.module('contactsApp')
.directive('detailsitem', ['$compile', function($compile) {
2016-02-22 20:34:10 +00:00
return {
scope: {},
controller: 'detailsItemCtrl',
controllerAs: 'ctrl',
bindToController: {
name: '=',
data: '=',
2016-03-03 16:57:04 +00:00
model: '='
2016-02-22 20:34:10 +00:00
},
link: function(scope, element, attrs, ctrl) {
ctrl.getTemplate().then(function(html) {
var template = angular.element(html);
element.append(template);
$compile(template)(scope);
});
}
};
}]);