search

Home  >  Q&A  >  body text

javascript - angularjs custom $error

I want to customize the request $error, and return the name of $error according to the interface request to determine the corresponding prompt for ng-show prompts to the user:
For example: regForm.$error.isWrong

PHPzPHPz2845 days ago629

reply all(1)I'll reply

  • 習慣沉默

    習慣沉默2017-05-19 10:16:30

    I don’t understand why $error needs to be redefined.
    Wouldn’t it be better if you process the $error returned by the interface, convert it into the desired format, and then implement two-way binding on the page?

    reply
    0
  • Cancelreply