Angular开发文档中一些常用的词汇

简介: Angular开发文档中一些常用的词汇
  • interpolation: 指Angular特有的双大括号语法{undefined{ }}
  • backticks: `
  • ASTERISK:[ˈæstərɪsk]
  • template reference variable, 语法是#:
    image.png

命名冲突的优先级:If you reference a name that belongs to more than one of these namespaces, the template variable name takes precedence, followed by a name in the directive’s context, and, lastly, the component’s member names.


template statement: responds to an event raised by a binding target such as an element, component, or directive.

例子:

image.png

statement context就是其所属的Component: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.


binding语法

<!-- 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无法修改。


相关文章
|
8月前
|
设计模式 JSON 监控
angular快速入门指南
angular快速入门指南
97 0
|
8月前
|
前端开发 JavaScript
Angular框架入门指南
Angular框架入门指南
154 0
|
10月前
|
设计模式 JavaScript 前端开发
学习Angular的编程之旅
学习Angular的编程之旅
|
JavaScript 前端开发 容器
|
JavaScript
Angular基础知识学习(一)下
Angular基础知识学习(一)下
156 0
Angular基础知识学习(一)下
|
前端开发 JavaScript 安全
Angular基础知识学习(一)上
Angular基础知识学习(一)上
152 0
Angular基础知识学习(一)上
|
JavaScript 开发者
Angular基础知识学习(二)上
Angular基础知识学习(二)上
99 0
Angular基础知识学习(二)上
|
前端开发 JavaScript 网络架构
Angular基础知识学习(三)
Angular基础知识学习(三)
128 0
Angular基础知识学习(三)
|
前端开发 JavaScript 安全
Angular基础知识学习(二)下
Angular基础知识学习(二)下
108 0
Angular基础知识学习(二)下
|
Web App开发 测试技术 C++
Angular最新教程-第三节在谷歌浏览器中调试Angular
Angular最新教程-第三节在谷歌浏览器中调试Angular
589 0
Angular最新教程-第三节在谷歌浏览器中调试Angular