HTML,значение атрибута доступа внутри недирективно функции контроллера
<button data-href="helloworld">Show href Value</button>
содержание Js,
$("body").on('click', 'button', function(){
console.log($(this).attr("data-href"));
});
Печатается
helloworld
в консоли. Я проникаю выше код для 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
})
Может кто-то помочь мне с аргументами и содержанием функциональных hello
контроллера?
необходимо будет 'нг-клик = "helloClick()"' –
покаянием ... обновленный ответ. благодаря –