Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit 2eaa156

Browse files
committed
added walkthrough
1 parent 317449b commit 2eaa156

File tree

11 files changed

+58
-16
lines changed

11 files changed

+58
-16
lines changed

src/app/operators/components/operator-examples/operator-examples.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2 class="examples-header"> Examples </h2>
1+
<h2> Examples </h2>
22
<div
33
class="code-example"
44
*ngFor="let example of operatorExamples"

src/app/operators/components/operator-examples/operator-examples.component.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.examples-header {
2-
margin: 32px 0 16px;
3-
}
4-
51
.code-block {
62
position: relative;
73
}

src/app/operators/components/operator/operator.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
</app-operator-header>
77
<section class="main-operator-container mat-typography">
88
<h3 class="short-description" [innerHTML]="shortDescription"></h3>
9-
<app-marble-diagram [url]="marbleUrl"></app-marble-diagram>
9+
<app-marble-diagram [url]="marbleUrl" class="margin-bottom-32"></app-marble-diagram>
10+
<app-operator-examples [operatorExamples]="examples" class="margin-bottom-16"></app-operator-examples>
1011
<app-operator-parameters [operatorParameters]="parameters"></app-operator-parameters>
11-
<app-operator-examples [operatorExamples]="examples"></app-operator-examples>
12+
<app-operator-walkthrough [operatorWalkthrough]="walkthrough" class="margin-bottom-16"></app-operator-walkthrough>
1213
<app-related-operators [relatedOperators]="relatedOperators"></app-related-operators>
1314
<app-additional-resources
1415
[additionalResources]="additionalResources"
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
h2 {
2-
margin: 16px 0 16px;
3-
}
4-
51
.main-operator-container {
62
padding: 5px;
73
display: flex;
84
flex-direction: column;
95
padding: 0 16px;
6+
margin-bottom: 16px;
107
}
118

129
.short-description {
1310
margin: 16px 0 32px;
1411
}
12+
13+
.margin-bottom-32 {
14+
margin-bottom: 32px;
15+
}
16+
17+
.margin-bottom-16 {
18+
margin-bottom: 16px;
19+
}

src/app/operators/components/operator/operator.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export class OperatorComponent {
2828
return this.operator.shortDescription && this.operator.shortDescription.description;
2929
}
3030

31-
get longDescription() {
32-
return this.operator.longDescription && this.operator.shortDescription.description;
31+
get walkthrough() {
32+
return this.operator.walkthrough && this.operator.walkthrough.description;
3333
}
3434

3535
get parameters() {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h2> Walkthrough </h2>
2+
<div class="walkthrough-container" [innerHTML]="operatorWalkthrough">
3+
4+
</div>

src/app/operators/components/walkthrough/walkthrough.component.scss

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component, Input } from '@angular/core';
2+
import { OperatorExample } from '../../../../operator-docs';
3+
4+
@Component({
5+
selector: 'app-operator-walkthrough',
6+
templateUrl: './walkthrough.component.html',
7+
styleUrls: ['./walkthrough.component.scss']
8+
})
9+
export class WalkthroughComponent {
10+
@Input() operatorWalkthrough: string;
11+
}

src/app/operators/operators.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { OperatorExamplesComponent } from './components/operator-examples/operat
2121
import { RelatedOperatorsComponent } from './components/related-operators/related-operators.component';
2222
import { AdditionalResourcesComponent } from './components/additional-resources/additional-resources.component';
2323
import { MarbleDiagramComponent } from './components/marble-diagram/marble-diagram.component';
24+
import { WalkthroughComponent } from './components/walkthrough/walkthrough.component';
2425

2526
import { OperatorScrollDirective } from './directives/operator-scroll.directive';
2627
import { HighlightJsDirective } from './directives/highlight-js.directive';
@@ -41,6 +42,7 @@ const OPERATOR_ROUTES = [
4142
OperatorExamplesComponent,
4243
RelatedOperatorsComponent,
4344
AdditionalResourcesComponent,
45+
WalkthroughComponent,
4446
MarbleDiagramComponent,
4547
OperatorScrollDirective,
4648
HighlightJsDirective

src/operator-docs/combination/combineAll.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,31 @@ export const combineAll: OperatorDoc = {
1616
'shortDescription': {
1717
'description': 'Flattens an Observable-of-Observables by applying <a href="/operators#combineLatest" class="markdown-code">combineLatest</a> when the Observable-of-Observables completes.'
1818
},
19-
'longDescription': {
20-
'description': ''
19+
'walkthrough': {
20+
'description': `
21+
<p>
22+
Takes an Observable of Observables, and collects all Observables from it.
23+
Once the outer Observable completes, it subscribes to all collected
24+
Observables and combines their values using the <a href="/operators#combineLatest" class="markdown-code">combineLatest</a>
25+
strategy, such that:
26+
</p>
27+
<ul>
28+
<li>Every time an inner Observable emits, the output Observable emits.</li>
29+
<li>When the returned observable emits, it emits all of the latest values by:
30+
<ul>
31+
<li>
32+
If a <span class="markdown-code">project</span> function is provided, it is called with each recent value
33+
from each inner Observable in whatever order they arrived, and the result
34+
of the <span class="markdown-code">project</span> function is what is emitted by the output Observable.
35+
</li>
36+
<li>
37+
If there is no <span class="markdown-code">project</span> function, an array of all of the most recent
38+
values is emitted by the output Observable.
39+
</li>
40+
</ul>
41+
</li>
42+
</ul>
43+
`
2144
},
2245
'examples': [
2346
{

0 commit comments

Comments
 (0)