1

In jQuery we can get append an event after append html:

$('ul').delegate('a','click',function() {
    // your code here ...
});

Or we can:

$(document).on('click','ul li a', function(){
       // your code here ..
});

How can we do it in AngularJS after append html?

<div ng-bind-html="getSomehtml(l)"></div>
$scope.getSomehtml= function (l) {
    let namepath = 'a/b/c';
    let t = namepath.split('/').map(function (text, i) {
        return '<span  ng-click="changeNamePath(' + i + ',' + namepath+')"' + i + '>' + text + '</span>';
    }).join('/');
    return t;
};
2
  • Does this answer your question? angulajs-ng-click-in-expression-html Commented Dec 9, 2019 at 6:46
  • 1
    @Rajesh Thanks, but my case namepath there is alot of row load from db. I hope have a best solution for it. Commented Dec 9, 2019 at 6:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.