how to trigger angular parsers without inputing anything in the field

angularjs, parsing, triggers

Solution

I have found a way to solve this - just call the parsers with the model value:

angular.forEach(ngModel.$parsers, function (parser) {
    parser(ngModel.$viewValue);
});

It`s so simple, and it seems to be the most correct solution.

Problem

As the subject states, how do I trigger the actions to take place inside a ``` modelController.$parsers(...) ``` without user input... the only way I can think of is wrapping them inside a function and call it, but is there a better way to trigger ``` **//pseudo $(modelController).trigger('just got dirty');** ``` the reason I would need this is to trigger the input field to validate itself on submitting page.

Original source