contacts/js/components/detailsItem/detailsItem_directive.js

22 lines
476 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: '=',
2017-10-31 19:16:59 +00:00
contact: '=model',
2017-02-09 21:28:47 +00:00
index: '='
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);
});
}
};
}]);