Append html to an element in directive and make a local function to interact with it
In my AngularJS application, I have different complex inputs everywhere. For example, some inputs have a directive to use autocompletion with Google Places or with autocompletion from Twitter Bootstrap. I'm searching for a way to make a directive which displays an erase button when we add some text like iOS feature. I made this one, but the scope.erase doesn't start, nor does the ng-show . Is it possible to add HTML after the text input and "play" with them inside the controller? My test: app.directive('eraseBtn', function($parse, $compile){ return { require: 'ngModel', restrict: "A",