BeastCode / VSCode-Angular-TypeScript-Snippets

Visual Studio Code TypeScript snippets (TypeScript, Html, Angular Material, Flex Layout, ngRx, RxJS & Testing) for Angular 17
https://marketplace.visualstudio.com/items?itemName=Mikael.Angular-BeastCode
MIT License
92 stars 49 forks source link

matDatePicker not working #69

Closed Bobrovskih closed 6 years ago

Bobrovskih commented 6 years ago

Hello, I use Angular 6 Snippets v6.0.12

and mat-datepicker not working extension output this template:

<mat-form-field>
    <input matInput [matDatepicker]="picker" placeholder="title">
        <button matSuffix [matDatepickerToggle]="picker"></button>
    </mat-form-field>
<mat-datepicker #picker></mat-datepicker>

then compile, and chrome console output error Can't bind to 'matDatepickerToggle' since it isn't a known property of 'button' ...

From https://material.angular.io/components/datepicker/examples date picker template should be like this:

<mat-form-field>
  <input matInput [matDatepicker]="picker" placeholder="Choose a date">
  <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
  <mat-datepicker #picker startView="year" [startAt]="startDate"></mat-datepicker>
</mat-form-field>
BeastCode commented 6 years ago

Looks like the datepicker been updated. Nice catch. Try it now.