` tag,
- you expect to bind to an event property that is also called `myClick`.这是使用 [attribute 指令](attribute-directives.html)时的常见情况。
+ you expect to bind to an event property that is also called `myClick`.
+
+ 这是使用 [attribute 指令](attribute-directives.html)时的常见情况。
指令的使用者期望绑定到指令名。例如,在`
`上用`myClick`选择器应用指令时,
希望绑定的事件属性也叫`myClick`。
+
+makeExample('template-syntax/ts/src/app/app.component.html', 'myClick')(format=".")
:marked
@@ -2689,7 +2882,10 @@ a#pipe
+makeExample('template-syntax/ts/src/app/app.component.html', 'pipes-2')(format=".")
:marked
- And you can also [apply parameters](./pipes.html#parameterizing-a-pipe) to a pipe:还能对它们使用参数:
+ And you can also [apply parameters](./pipes.html#parameterizing-a-pipe) to a pipe:
+
+ 还能对它们使用参数:
+
+makeExample('template-syntax/ts/src/app/app.component.html', 'pipes-3')(format=".")
:marked
@@ -2751,11 +2947,13 @@ a#safe-navigation-operator
code-example(language="html").
The null hero's name is {{nullHero.name}}
+:marked
+ JavaScript throws a null reference error, and so does Angular:
- :marked
- JavaScript throws a null reference error, and so does Angular:
- JavaScript 抛出了空引用错误,Angular 也是如此:code-example(format="nocode").
- TypeError: Cannot read property 'name' of null in [null].
+ JavaScript 抛出了空引用错误,Angular 也是如此:
+
+code-example(format="nocode").
+ TypeError: Cannot read property 'name' of null in [null].
:marked
Worse, the *entire view disappears*.