D
D
Deodatuss2016-04-05 12:56:32
Angular
Deodatuss, 2016-04-05 12:56:32

How to make an input touched or dirty programmatically in Angular2?

I know it sounds dumb. But it so happened that one jquery plugin needs to be friends with Angular2. In general terms, this plugin creates a copy of a piece of html that has inputs. When changing data in angular, it is re-rendered with all errors, etc. But it is necessary that the data was thrown in the opposite direction. I did it via ControlGroup.controls['control_id'].updateValue(value,{emitEvent,emitModelToViewChange}).
All is well, the data is coming. But the angular input where I push the data does not become dirty or touched, but I need it to display errors. How to make an input become touched or dirty? Thanks in advance.
PS: I know that this is not correct, but so far it's the only way

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question