Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngModel parse errors always use named parser #10076

Closed
javascript-indonesias/angular.js
#37
@Narretz

Description

@Narretz

For our core parsers, we use a private / undocumented property called $$parserName, so that the $error is named, e.g. $error.date. Other parsers will always set $error.parse. When you have something like this:

<input type="date" my-parser ng-model="asdf"/>

where myParser adds:

ctrl.$parsers.push(function() {
  return undefined;
});

the $error will nevertheless be date, because the $$parserName is set in the link function, and $$runValidators will always use the $$parserName if it is set.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions