Suppose I have a link:
a data-pressed="false" ng-click="func(...)" How to transfer data-pressed value in func ?
Suppose I have a link:
a data-pressed="false" ng-click="func(...)" How to transfer data-pressed value in func ?
In this case - no way.
Instead of passing an attribute, you should pass the parameter directly:
a ng-click="func(false)" The same works if an angular expression was used for the attribute value.
a ng-click="func(expression)" Like this:
data-pressed="false" ng-click="func($(this).data('pressed'))" ng-click an angular expression is passed, in this is not an element, but scope , besides all functions and variables in the markup are taken from the scope, and if there is no $ property in it, then the global variable $ not will be used - GrundySource: https://ru.stackoverflow.com/questions/372090/
All Articles