Hi! I have this error after update to 3.0.0 with the mdAutocomplete component
The property "auto" that you're trying to access does not exist in the class declaration.
The code:
<md-input-container>
<input type="text" mdInput placeholder="Search..." [mdAutocomplete]="auto" />
<md-autocomplete #auto="mdAutocomplete">
<md-option *ngFor="let item of options" [value]="item">{{item.name}}</md-option>
</md-autocomplete>
</md-input-container>
Any idea? thanks!
3.0.0 does "flat analysis", i.e. it won't consider the entire project (won't collect the entire metadata for your project) which means that it will not be able to discover the mdAutocomplete template reference.
Take a look at this section for more details. Also, you may consider going back to 3.0.0-beta.x https://github.com/mgechev/codelyzer/issues/191#issuecomment-296697740.
As a workaround, you can instantiate using the @ViewChild decorator on your @Component, like so:
@ViewChild('auto') auto: ElementRef;
thanks @leocaseiro , it works!
Most helpful comment
As a workaround, you can instantiate using the
@ViewChilddecorator on your@Component, like so: