Html content as,
<div ng-controller="logCtrl">
<ul>
<li ng-click="logMe" someAttr="hello ricky">hello martin</li>
</ul>
</div>
Javascript content as,
var app = angular.module('app', []);
app.controller('logCtrl', function ($scope, $element) {
$scope.logMe = function(){
console.log("html content is " + /*---- how can i print $element's inner html text here --- */)
console.log("attribute value is " + /*---- how can i read the li element's someAttr value here --- */)
}
})
This must print this message in the console (when user clicks the mouse),
html content is hello martin
attribute value is hello ricky