ajax - Angularjs custom validation directive Async call real time validation -


After

I am using custom verification instructions to validate an area in one form and confirm user information with the verification process To include an AJAX call to the server API, we want to validate this area until the user closes the typing for a certain period.

I have two questions:

1. Why is not working below? (With link function in the custom command) the log message was never shown how often I can type in the closed input field (I'm pretty sure that since the log log is enabled other logs Was shown properly)

  scope. $ Watch (attrs.ngModel, function (change in "$ log.debug" ("+ scope. $ Eval (attrs.ngModel));});   

2. What is the best way to ascertain that the user has stopped typing for the program to execute the verification process? And if the user starts to rewrite it will cancel the verification process before it expires Is it possible to do?

attrs.ngModel html in context String in To what you want to do, bind the ngModel value to the scope of the instruction:

  Scope: {Model: '= ngModel'}   < P> Then see the instructions scope:  
  area. $ Watch ("model", function () {console.log ("changed");});   

Example:

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -