Angular ng blur Event Example
Today, We want to share with you Angular ng blur Event Example.
In this post we will show you Angular ng blur Event Example, hear for Angular ng blur Event Example we will give you demo and example for implement.
In this post, we will learn about Angular ng blur Event Example with an example.
Simple AngularJS ng-blur Event Example
The AngularJS ng-blur events or directive specifies that HTML tag what to do if Simple HTML form element (Like input,select.) loses focus input,select,etc.. HTML tag.Angularjs ng-blur event with example
[php]
IMP NOTE : This ng-blur events or directive is only supported by the HTML FORM tags like HTML tag list of following , 1st : , 2nd is , third is , fourth is
[/php]
Basic Syntax of AngularJS ng-blur Basic Event Directive with Example
[php]
****Simple your code***
****Simple your code***
Element Lists : , ,
In Angularjs, ngblur directive to call Javascript function with Simple Example
[php]
AngularJs call function ng-blur Event Example : step-by-step
Simple AngularJs ng-blur Event function or Directive Example – step by step
Write your text here:
{{dataresult}}
[/php]
Blur directive in AngularJS
There is no easy direct used for blur event in AngularJs.
But we can add used for blur event by Simple creating directive.
File : javascript
[php]
Module.directive(‘ng-blur’, function() { //ng-blur call directive
return { //return function
restrict: ‘A’,
link: function postLink(scope, element, attrs) { // call a function
element.bind(‘blur’, function () { // expression bind executes
scope.$apply(attrs.ngBlur); // change response
});
}
};
});
[/php]
File Name : html template: index.html
[php]
[/php]
handle controller in ng-blur event:
[php]
$scope.handleChangeInputEvent = function(){
$scope.resultdata=”The Specify custom behavior change on blur event data.”;
}
[/php]
Second way : Angularjs call simple Javascript function in ng-blur event
[php]
userm.handleChangeEvent = function(salesorder)
{
alert(salesorder.price); //Simple new display the NEW price here : –
}
[/php]