i am trying to remove an element using directive
i found a working example http://jsfiddle.net/qDhT9
and i tried to append a new element and having the thing as http://jsfiddle.net/qDhT9/140
var app = angular.module('myApp', []);
app.directive('removeOnClick', function() {
return {
link: function(scope, elt, attrs) {
scope.remove = function() {
alert('here');
elt.html('');
};
elt.append('<a href class="close" style="float:right;padding-right:0.3em" ng-click="remove()">×</a>');
}
}
});
but this
one does not worked.
Why and how to make the second one work.