components icon indicating copy to clipboard operation
components copied to clipboard

<md-input> does not set template reference variable on <input/> element.

Open robkuijpers opened this issue 10 years ago • 5 comments

When I add a template reference variable (using # or ref- on an md-input it is not set on the element.

I followed the Angular2 forms tutorial https://angular.io/docs/ts/latest/guide/forms.html and noticed this when trying to add the #spy variable.

Is there a way to use template reference variables or is this planned for a future version?

@angular 2.0.0-rc.4 @angular/forms 0.2.0 @angular2-material 2.0.0-alpha.6

node 5.11.1 npm 3.8.6 tsc 1.8.10 OSX 10.11.5 Chrome 51.0.2704.103

robkuijpers avatar Jul 13 '16 17:07 robkuijpers

I tested a simple code like:

<md-input #test placeholder="First name"></md-input>   
{{ test.characterCount }} 

and this is the result:

image

How you use the #spy var?

Dona278 avatar Jul 14 '16 20:07 Dona278

Not presently, though the md-input should expose all APIs you would need. Working as intended for now.

jelbourn avatar Jul 14 '16 23:07 jelbourn

Hi Dona278,

Your example works, thanks.

I followed the Angular2 forms tutorial https://angular.io/docs/ts/latest/guide/forms.html trying to add the #spy variable to show the angular validation classes.

kuijpersr avatar Jul 15 '16 15:07 kuijpersr

not working for me i had to switch to bootstrap style instead

ghost avatar Dec 22 '16 16:12 ghost

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.