javascript - ng-click Angular JS issue -



javascript - ng-click Angular JS issue -

new angular js, trying access click event using ng-click.

html:

<button ng-click="selectnav($event)">click</button>

js:

angular.module('app').controller('ctrl', function(){ $scope.selectnav = function($event){ console.log($event); } });

on click of button, not giving value of $event. can 1 allow me know going wrong.

i've noticed didn't pass $scope controller. seek prepare maybe

angular.module('app').controller('ctrl', function($scope){ $scope.selectnav = function($event){ console.log($event); } });

javascript jquery angularjs

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -