I'm new to angular. I have added custom attribute to span tag like below
<span data-toggle="modal" data-target="#myModal" style="padding: 2px;cursor: pointer;background: #e60000;color: #fff" (click)="loadnewsdetail()" [attr.newsid]="news.NewsId">Read More </span>
I want to get value of attribute newsid for that I'm doing below code using jQuery
loadnewsdetail() {
var a = $(this).attr('newsid');
alert(a);
}
It giving me undefined. How to do this in angular and why it's undefined?