I'm using angularjs, and I want to obtain the html element by simply mark an ng-tag.
<div ng-xxxx="myDiv"></div>
console.log($scope.myDiv); //<div ng-xxxx="myDiv"></div>
Can someone tech me how it can be done?
I'm using angularjs, and I want to obtain the html element by simply mark an ng-tag.
Can someone tech me how it can be done? |
|||||||||
|
Here is a plunkr sample that should be close to what you're looking for, or at least a good starting point. https://plnkr.co/edit/QVd5WJEGq7B9WWyXJBSu?p=preview So here is an attribute directive, that uses method binding (& binding), which means it accepts an angular expression
|
|||||||||
|