I have created an angular directive.
The goal of my directive is to change text of the button that is being clicked.
My problem is that my directive is working with all the buttons of the first/main page, but when I display a popup in my <div ui-view></div>
that has a button with this directive, it doesn't work.
app.directive('callbutton', function() {
return {
restrict: 'E',
replace: true,
transclude: true,
template: '<button type="button" class="btn btn-block btn-lg btn-success"><i class="fa fa-phone"></i> Call</button>',
link: function(scope, elem, attrs) {
elem.bind("click", function{
elem.text('other text');
})
}
}
});
Thanks in advance.