I believe you have to use let-myVar="myVal"
#var is only for actual element/component references in recent version. Cheers, Ben On Wed, Jul 6, 2016 at 10:46 AM, Apurv Singhal <[email protected]> wrote: > How do I set local variables inside html templates? > <span #myVar="myVal"></span> gives an error > *ngFor lets you set a local variable using let but that is only for arrays. > > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- Ben Nadel Lover of JavaScript http://www.bennadel.com -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
