angularjs - How to use $(this) in $scope functions on Angular JS + jQuery -
i wanted ask why $(this) selector doesn't work inside $scope functions in angular js + jquery.
i have sample code:
[javascript]
$scope.starttimer = function() { $(this).hide(); } [html]
<button ng-click="starttimer()"> i've tried doing still doesn't work:
[javascript]
$scope.starttimer = function(btn) { $(btn).hide(); } [html]
<button ng-click="starttimer(this)"> anyone knows how fix this? sorry noob question.
do angular way...
[html]
<button ng-click="starttimer()" ng-hide="btnhide"> [javascript]
$scope.starttimer = function(btn) { btnhide = true; }
Comments
Post a Comment