fix few compiling errors(live examples)
This commit is contained in:
parent
4578087fa5
commit
23984f8caf
|
@ -9,4 +9,4 @@ header(class="background-sky l-relative")
|
|||
.announcement-bar-slide.clearfix
|
||||
img(src="/resources/images/logos/anglebrackets/devintersection.png" width="64")
|
||||
p 参加11月14-16号的<strong>DEVintersection Amsterdam</strong>!
|
||||
a(href="https://www.devintersectioneurope.com/#!/" target="_blank" class="button md-button") Register now
|
||||
a(href="https://www.devintersectioneurope.com/#!/" target="_blank" class="button md-button") 立即注册!
|
||||
|
|
|
@ -84,7 +84,7 @@ figure
|
|||
.l-sub-section
|
||||
p The code referenced on this page is available as a <live-example></live-example>.
|
||||
|
||||
p 本章所引用的代码可以从这个#[+liveExampleLink2('在线例子')]。
|
||||
p 本章所引用的代码可以从这个<live-example>在线例子</live-example>。
|
||||
|
||||
.l-main-section
|
||||
:marked
|
||||
|
|
|
@ -510,9 +510,9 @@ block pure-change
|
|||
我们把`FlyingHeroesPipe`换成了`FlyingHeroesImpurePipe`。
|
||||
下面是完整的实现:
|
||||
+makeTabs(
|
||||
'pipes/ts/app/flying-heroes.pipe.ts, pipes/ts/app/flying-heroes.pipe.ts',
|
||||
'impure, pure',
|
||||
'FlyingHeroesImpurePipe, FlyingHeroesPipe')(format='.')
|
||||
'pipes/ts/app/flying-heroes.pipe.ts, pipes/ts/app/flying-heroes.pipe.ts',
|
||||
'impure, pure',
|
||||
'FlyingHeroesImpurePipe, FlyingHeroesPipe')(format='.')
|
||||
|
||||
:marked
|
||||
We inherit from `FlyingHeroesPipe` to prove the point that nothing changed internally.
|
||||
|
@ -541,7 +541,7 @@ block pure-change
|
|||
|
||||
p.
|
||||
唯一的重大改动就是管道。
|
||||
我们可以在#[+liveExampleLink('在线例子')]中确认,当我们输入新的英雄甚至修改#[code heroes]数组时,这个#[i 会飞的英雄]的显示也跟着更新了。
|
||||
我们可以在<live-example>在线例子</live-example>中确认,当我们输入新的英雄甚至修改#[code heroes]数组时,这个#[i 会飞的英雄]的显示也跟着更新了。
|
||||
|
||||
- var _dollar = _docsFor === 'ts' ? '$' : '';
|
||||
h3#async-pipe The impure #[i AsyncPipe]
|
||||
|
@ -741,8 +741,8 @@ a(id="no-filter-pipe")
|
|||
|
||||
虽然不是很明显,但代码最小化方面也存在风险。想象一个用于英雄列表的排序管道。我们可能根据英雄原始属性中的`name`和`planet`进行排序,就像这样:
|
||||
code-example(language="html")
|
||||
<!-- NOT REAL CODE! -->
|
||||
<div *ngFor="let hero of heroes | orderBy:'name,planet'"></div>
|
||||
<!-- NOT REAL CODE! -->
|
||||
<div *ngFor="let hero of heroes | orderBy:'name,planet'"></div>
|
||||
:marked
|
||||
We identify the sort fields by text strings, expecting the pipe to reference a property value by indexing
|
||||
(e.g., `hero['name']`).
|
||||
|
|
|
@ -68,7 +68,7 @@ block includes
|
|||
The <live-example></live-example>
|
||||
demonstrates all of the syntax and code snippets described in this chapter.
|
||||
p.
|
||||
这个#[+liveExampleLink2('在线例子')]演示了本章中描述的所有语法和代码片段。
|
||||
这个<live-example>在线例子</live-example>演示了本章中描述的所有语法和代码片段。
|
||||
|
||||
.l-main-section
|
||||
:marked
|
||||
|
@ -1389,15 +1389,15 @@ block style-property-name-dart-diff
|
|||
这都是好事。
|
||||
|
||||
//
|
||||
:marked
|
||||
### Event bubbling and propagation [TODO: reinstate this section when it becomes true]
|
||||
Angular invokes the event-handling statement if the event is raised by the current element or one of its child elements.
|
||||
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-bubbling')(format=".")
|
||||
:marked
|
||||
Many DOM events, both [native](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Overview_of_Events_and_Handlers ) and [custom](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events ), bubble up their ancestor tree of DOM elements until an event handler along the way prevents further propagation.
|
||||
:marked
|
||||
### Event bubbling and propagation [TODO: reinstate this section when it becomes true]
|
||||
Angular invokes the event-handling statement if the event is raised by the current element or one of its child elements.
|
||||
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-bubbling')(format=".")
|
||||
:marked
|
||||
Many DOM events, both [native](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Overview_of_Events_and_Handlers ) and [custom](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events ), bubble up their ancestor tree of DOM elements until an event handler along the way prevents further propagation.
|
||||
|
||||
.l-sub-section
|
||||
:marked
|
||||
:marked
|
||||
`EventEmitter` events don’t bubble.
|
||||
|
||||
:marked
|
||||
|
|
|
@ -29,7 +29,7 @@ block includes
|
|||
|
||||
Run the <live-example></live-example> for this part.
|
||||
|
||||
p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-6')]。
|
||||
p 运行这部分的<live-example>在线例子</live-example>。
|
||||
|
||||
.l-main-section
|
||||
:marked
|
||||
|
@ -934,36 +934,36 @@ block filetree
|
|||
block file-summary
|
||||
+makeTabs(
|
||||
`toh-6/ts/app/app.component.ts,
|
||||
toh-6/ts/app/app.module.ts,
|
||||
toh-6/ts/app/heroes.component.ts,
|
||||
toh-6/ts/app/heroes.component.html,
|
||||
toh-6/ts/app/heroes.component.css,
|
||||
toh-6/ts/app/hero-detail.component.ts,
|
||||
toh-6/ts/app/hero-detail.component.html,
|
||||
toh-6/ts/app/hero.service.ts,
|
||||
toh-6/ts/app/in-memory-data.service.ts`,
|
||||
toh - 6 / ts / app / app.module.ts,
|
||||
toh - 6 / ts / app / heroes.component.ts,
|
||||
toh - 6 / ts / app / heroes.component.html,
|
||||
toh - 6 / ts / app / heroes.component.css,
|
||||
toh - 6 / ts / app / hero - detail.component.ts,
|
||||
toh - 6 / ts / app / hero - detail.component.html,
|
||||
toh - 6 / ts / app / hero.service.ts,
|
||||
toh - 6 / ts / app / in -memory - data.service.ts`,
|
||||
',,,,,,,,',
|
||||
`app.comp...ts,
|
||||
app.mod...ts,
|
||||
heroes.comp...ts,
|
||||
heroes.comp...html,
|
||||
heroes.comp...css,
|
||||
hero-detail.comp...ts,
|
||||
hero-detail.comp...html,
|
||||
hero - detail.comp...ts,
|
||||
hero - detail.comp...html,
|
||||
hero.service.ts,
|
||||
in-memory-data.service.ts`
|
||||
)
|
||||
|
||||
+makeTabs(
|
||||
`toh-6/ts/app/hero-search.service.ts,
|
||||
toh-6/ts/app/hero-search.component.ts,
|
||||
toh-6/ts/app/hero-search.component.html,
|
||||
toh-6/ts/app/hero-search.component.css,
|
||||
toh-6/ts/app/rxjs-extensions.ts`,
|
||||
toh - 6 / ts / app / hero - search.component.ts,
|
||||
toh - 6 / ts / app / hero - search.component.html,
|
||||
toh - 6 / ts / app / hero - search.component.css,
|
||||
toh - 6 / ts / app / rxjs - extensions.ts`,
|
||||
null,
|
||||
`hero-search.service.ts,
|
||||
hero-search.component.ts,
|
||||
hero-search.component.html,
|
||||
hero-search.component.css,
|
||||
rxjs-extensions.ts`
|
||||
hero - search.component.ts,
|
||||
hero - search.component.html,
|
||||
hero - search.component.css,
|
||||
rxjs - extensions.ts`
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue