The statement context is typically the component instance. The deleteHero in (click)=“deleteHero()” is a method of the data-bound component.
优先级:Template context names take precedence over component context names. In deleteHero(hero) above, the hero is the template input variable, not the component’s hero property.
<!-- Bind button disabled state to `isUnchanged` property -->
<button [disabled]="isUnchanged">Save</button>
Notice that the binding is to the disabled property of the button’s DOM element, not the attribute. This applies to data-binding in general. Data-binding works with properties of DOM elements, components, and directives, not HTML attributes.
The distinction between an HTML attribute and a DOM property is key to understanding how Angular binding works. Attributes are defined by HTML. Properties are accessed from DOM (Document Object Model) nodes. - 完全两码事!
Attributes initialize DOM properties and then they are done. Property values can change; attribute values can’t. - HTML attribute用来初始化DOM properties,之后就没有用了. HTML attribute无法修改。