Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Open
@sultanmyrza

Description

@sultanmyrza
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.