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

Create snippet for Material Autocomplete is outdated (mat-autocomplete and mat-autocomplete$) #114

Open sultanmyrza opened 5 years ago

sultanmyrza commented 5 years ago

current auto generated code for mat-autocomplete is outdated

actual

<mat-input-container floatPlaceholder="always">
    <input matInput placeholder="" [matAutocomplete]="autocompleteTemplateRefId"
           formControlName="formControlName">
</mat-input-container>

<mat-autocomplete #autocompleteTemplateRefId="matAutocomplete"
                  [displayWith]="onSelectConvertValueToInputFn">
    <mat-option *ngFor="let choice of choices | async" [value]="choice">
        Choice shown in dropdown
    </mat-option>
</mat-autocomplete>

expected

<mat-form-field floatLabel="always">
    <input matInput placeholder="" [matAutocomplete]="autocompleteTemplateRefId"
           formControlName="formControlName">
</mat-form-field>

<mat-autocomplete #autocompleteTemplateRefId="matAutocomplete"
                  [displayWith]="onSelectConvertValueToInputFn">
    <mat-option *ngFor="let choice of choices | async" [value]="choice">
        Choice shown in dropdown
    </mat-option>
</mat-autocomplete>

now instead mat-input-container we use mat-form-field because breaking changes https://github.com/angular/components/blob/master/CHANGELOG.md#600-beta5-2018-03-23

and for floatPlaceholder we use floatLabel more info https://stackoverflow.com/a/48540947

I really enjoy using these code snippets please fix as soon as possible or let me know how can I fix myself and create pull-request

Frankystan commented 2 weeks ago

I agree. It should be updated