Reputation: 6563
The below snippet is in directive. I'm calling directive from controller. passing formname="'AddressForm'"
from controller.
<div ng-messages="formname.Zip.$error"
ng-show="(!formname.Zip.$pristine || formname.$submitted)">
</div>
I've tried ng-messages="{{formname}}.Zip.$error"
and got below error
Token '{' invalid key at column 2 of the expression [{{formname}}.Zip.$error] starting at [{::formname}}.Zip.$error].
How can i get formname ?
Upvotes: 0
Views: 12