I have the following
compile : function($scope, $element, $attrs, parentCtrl) {
return {
pre : function($scope, $element, $attrs, parentCtrl) {
if($scope.feature == 'drop') {
$element.find('.playlist').attr('droppable', true);
}
},
post : function($scope, $element, $attrs, parentCtrl) {
$scope.$parent.$watch('chosen', function(newAsset) {
if(typeof newAsset != 'undefined' && newAsset.hasOwnProperty('id')) {
$scope.list.resource = newAsset.id;
$scope.list.loadData();
}
});
}
}
}
now.... 'droppable' is a directive. But from what I can see - it's not being handled / compiled. If this is dymanically added within the 'compile-pre' should it be compiled by Angular?
How should I deal with dynamically generated directives?
compilefunction. You can add directives to child elements though.