components icon indicating copy to clipboard operation
components copied to clipboard

autocomplete: There is no directive with "exportAs" set to "mdAutocomplete"

Open pbuhrmann opened this issue 9 years ago • 4 comments

Bug, feature request, or proposal:

Runtime error: There is no directive with "exportAs" set to "mdAutocomplete"

What is the expected behavior?

What is the current behavior?

Runtime error: There is no directive with "exportAs" set to "mdAutocomplete"

What are the steps to reproduce?

npm install @angular/material@latest @angular/cdk@latest --save

<md-form-field>
    <input type="text" placeholder="Pick one" mdInput [formControl]="myControl [mdAutocomplete]="auto">
    <md-autocomplete #auto="mdAutocomplete">
      <md-option *ngFor="let option of filteredOptions | async" [value]="option">
        {{ option }}
      </md-option>
    </md-autocomplete>
  </md-form-field>

This code works on Plunker, it does not work however when using version from npm.

Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: https://goo.gl/DlHd6U

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Is there anything else we should know?

pbuhrmann avatar Sep 28 '17 15:09 pbuhrmann

See #7361

donroyco avatar Sep 28 '17 15:09 donroyco

Are you on latest angular version?

jymdman avatar Sep 28 '17 15:09 jymdman

It's most likely because you're on an older Angular version. Updating to 4.4.3 should resolve it.

crisbeto avatar Sep 28 '17 16:09 crisbeto

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.