How do I access the mat-date-range-Picker’s isComplete() method in the template?

Asked

Viewed 17 times

0

I’m trying to access the method isComplete() of mat-date-range-Picker in my template:

You should select the range date But I’m getting this mistake:

error TS2339: Property 'isComplete' does not exist on type 'Matdaterangepicker

According to the documentation the isComplete() method checks whether the current selection has been completed (if initial date and final date have been selected).

How to access this method in my template?

  • The right way would be to call this method every time the date value changes and set a property and check this property in your template

  • according to the documentation this method no longer does exactly that?

  • at the angle should not use methods as values in the template

  • how so? in this case I would use in *ngIf, depending on the value it would render or not

  • Set method value on a property and do ngif based on that property

  • what would be your suggestion? assign to a variable? create a pipe?

  • assign to a variable exactly

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.