Why does the directive ng-href need {{}} while other directives don't?
问题 I am just wondering why I need to add double curly braces for ng-href while some of the other directives don't need them? <a ng-href="{{myScopeVar}}" ng-if="myScopeVar">link</a> Notice that ng-href needs braces while ng-if doesn't. 回答1: I am not quite sure about your question. But i think your are wondering why there are different syntax styles in angular directives. First off all, please have a look at this post: Difference between double and single curly brace in angular JS? The answer