I've tried to check if form is pristine:
@ViewChild('myForm') form : ElementRef;
var pristine = this.form.nativeElement.hasClass('ng-pristine')
However, I get error:
this.form.nativeElement.hasClass
So, apparently, the solution from Angular 1 (How to check if element has class with AngularJS?) doesn't work here.
What is the way to do that in Angular 2?