Angularjs–ngmodelcontroller detailed

Source: Internet
Author: User

    • Ngmodelcontroller method
        • $render ();

      It is called when the view needs to be updated. Instructions that use Ng-model should implement this method on their own.

        • $isEmpty (value);

      This method is used to determine whether the input value is empty.
      For example, a directive that uses ngmodelcontroller requires that the method be used when it is necessary to determine if there are any input values. This method can be used to determine whether the value is undefined, ', null, or Nan.
      You can reload the method to suit your needs.

        • $setValidity (Validationerrorkey, isValid);

      This method is used to change the validation status and to notify the table when the validation criteria for changes are controlled.
      This method should be called by a validator. For example, a parser or a format function.

        • $setPristine ();

      This method is used to set control to the original state.
      The method can remove the ' Ng-dirty ' class and restore control to its original state (' Ng-pristine ' Class).

        • $setViewValue (value, Trigger) method

          This method is used to update the view values. This method should be called when a view value has changed, typically in a DOM event handler function. For example, the input and select Directives Call this function.
          This method will update the $viewvalue property and pass the value to each function in $pasers, which includes the validator. When this value is output from $parsers, it will be used for expressions in $modelvalue and Ng-model properties.
          Finally, all listeners registered in the $viewchangelisteners list will be called.

        • $cancelUpdate ();

      This method is used to cancel an update and reset the value of the INPUT element to prevent $viewcalue from occurring, which is raised by a pending debounced event or because the input box waits for some future event.

Angularjs–ngmodelcontroller detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.