Angualr1 Additional Cheatsheet

angular1

// Angular 1 - Miscellaneous:

AngularJS has some methods called JQlite so we can use it:

angular.element(domElement).addClass('cssClassName');
angular.element(domElement).removeClass('cssClassName');

To use ng-blur and ng-focus:

<my-input ng-blur="onBlur($event)" ng-focus="onFocus($event)"></my-input>

and in our controller, we add the function to the $scope:

$scope.onBlur = function(event) {
  angular.element(event.currentTarget).addClass('cssClassName');
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License