Here is some HTML content,
<button data-href="helloworld">Show href Value</button>
And here is some Javascript content,
$("body").on('click', 'button', function(){
console.log($(this).attr("data-href"));
});
When executed, this will print
helloworld
in the console. I am now transitioning this 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(){
// I need assistance with determining what services to inject and
//how to structure the logic to display the data-href attribute value
})
Could anyone provide guidance on the hello
controller function parameters and implementation?