HTML content,
<button data-href="helloworld">Show href Value</button>
Js content,
$("body").on('click', 'button', function(){
console.log($(this).attr("data-href"));
});
This prints
helloworld
in the console. I am migrating the above code to angularjs,
<div ng-controller="hello">
<button data-href="helloworld">Show href Value</button>
</div>
var app = angular.module('app', []);
app.controller("hello", function(){
//someone help me with the services that are to be injected and
//and what logic goes here to print the data-href attribute value
})
Can someone help me with the hello
controller function arguments and contents?