I'm new to angular. ng-click seems like a pretty core directive, I don't understand how you can make an app without ng-click. Am I missing something? Apparently it's deprecated. And the docs point me to fastclick but that's not an angular implementation.
Is there a popular non-deprecated way of doing what ng-click did? I couldn't find any popular packages on bower for this. Thanks.
isDisabled = false; $scope. disableButton = function() { $scope. isDisabled = true; // To disable Button } }); This way you can disable button.
Selecting an update version If there is a big version gap between your application's AngularJS version and the latest, try updating versions incrementally. For example, if your application is running AngularJS 1.2, do not immediately upgrade it to 1.6. 6. Instead choose a version closer to 1.2.
With it you can mix and match AngularJS and Angular components in the same application and have them interoperate seamlessly. That means you don't have to do the upgrade work all at once, since there is a natural coexistence between the two frameworks during the transition period.
By default AngularJS compiles and executes all directives inside comments and element classes. In order to perform this task, the AngularJS compiler must look for directives by: Parse all your application element classes. Parse all your application html comments.
ng-click
is only being deprecated within the ngTouch module due to delays when used in mobile browsers.
Beginning with Angular 1.5, this directive is deprecated and by default disabled. The directive will receive no further support and might be removed from future releases. If you need the directive, you can enable it with the $touchProvider#ngClickOverrideEnabled function. We also recommend that you migrate to FastClick. To learn more about the 300ms delay, this Telerik article gives a good overview.
Regular ngClick in the core ng
module will remain unaffected.
If you do infact need to use fastclick as an alternative there are a couple of angular wrapped versions available. One, Two.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With