Last active
October 24, 2016 10:57
-
-
Save zmts/5f38048bbc98affd5b5d51dceaa29b24 to your computer and use it in GitHub Desktop.
Get some data from data-'blabala' AngularJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in DOM >> | |
<div class="wantedData" ng-click="vm.getSomeDataValue($event)" data-some="ololo"><> | |
// in controller >> | |
function getSomeDataValue(e) { | |
console.log( angular.element(e.target).data('some') ); | |
} | |
// result | |
"ololo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment