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 -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -