Skip to content

Commit a78eaf5

Browse files
committed
docs(test-app): pipe with params example
1 parent 70ab381 commit a78eaf5

File tree

8 files changed

+54
-36
lines changed

8 files changed

+54
-36
lines changed
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"demo": {
3-
"simple": {
4-
"text-as-attribute": "Isolated: Text als Attribut",
5-
"text-as-content": "Isolated: Text als Inhalt"
6-
},
7-
"title": "Isolated: Test Anwendung"
2+
"demo": {
3+
"simple": {
4+
"text-as-attribute": "Isolated: Text als Attribut",
5+
"text-as-content": "Isolated: Text als Inhalt",
6+
"text-as-pipe-with-params": "Isolated: Text als Pipe mit {{value}}"
87
},
9-
"standalone-component": {
10-
"title": "Isolated: Eigenständige Komponente"
11-
}
8+
"title": "Isolated: Test Anwendung"
9+
},
10+
"standalone-component": {
11+
"title": "Isolated: Eigenständige Komponente"
12+
}
1213
}
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"demo": {
3-
"simple": {
4-
"text-as-attribute": "Isolated: Text as attribute",
5-
"text-as-content": "Isolated: Text as content"
6-
},
7-
"title": "Isolated: Test Application"
2+
"demo": {
3+
"simple": {
4+
"text-as-attribute": "Isolated: Text as attribute",
5+
"text-as-content": "Isolated: Text as content",
6+
"text-as-pipe-with-params": "Isolated: Text as pipe with {{value}}"
87
},
9-
"standalone-component": {
10-
"title": "Isolated: Standalone Component"
11-
}
8+
"title": "Isolated: Test Application"
9+
},
10+
"standalone-component": {
11+
"title": "Isolated: Standalone Component"
12+
}
1213
}
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"demo": {
3-
"simple": {
4-
"text-as-attribute": "Global: Text als Attribut",
5-
"text-as-content": "Global: Text als Inhalt"
6-
},
7-
"title": "Global: Test Anwendung"
2+
"demo": {
3+
"simple": {
4+
"text-as-attribute": "Global: Text als Attribut",
5+
"text-as-content": "Global: Text als Inhalt",
6+
"text-as-pipe-with-params": "Global: Text als Pipe mit {{value}}"
87
},
9-
"standalone-component": {
10-
"title": "Global: Eigenständige Komponente"
11-
}
8+
"title": "Global: Test Anwendung"
9+
},
10+
"standalone-component": {
11+
"title": "Global: Eigenständige Komponente"
12+
}
1213
}
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"demo": {
3-
"simple": {
4-
"text-as-attribute": "Global: Text as attribute",
5-
"text-as-content": "Global: Text as content"
6-
},
7-
"title": "Global: Test Application"
2+
"demo": {
3+
"simple": {
4+
"text-as-attribute": "Global: Text as attribute",
5+
"text-as-content": "Global: Text as content",
6+
"text-as-pipe-with-params": "Global: Text as pipe with {{value}}"
87
},
9-
"standalone-component": {
10-
"title": "Global: Standalone Component"
11-
}
8+
"title": "Global: Test Application"
9+
},
10+
"standalone-component": {
11+
"title": "Global: Standalone Component"
12+
}
1213
}

projects/test-app/src/app/components/page-content/page-content.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ <h2>Simple translations without parameters</h2>
77
<p [translate]="'demo.simple.text-as-attribute'"></p>
88

99
<p translate>demo.simple.text-as-content</p>
10+
11+
<p>{{ "demo.simple.text-as-pipe-with-params" | translate: { value: "params" } }}</p>
1012
</div>
1113

1214
<app-standalone-component />

projects/test-app/src/app/components/page-content/page-content.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { ChangeDetectionStrategy, Component } from "@angular/core";
2+
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
3+
import { MatFormFieldModule } from "@angular/material/form-field";
4+
import { MatSelectModule } from "@angular/material/select";
25
import { TranslateDirective, TranslatePipe } from "@ngx-translate/core";
36
import { StandaloneComponent } from "../standalone/standalone.component";
47

@@ -11,6 +14,12 @@ import { StandaloneComponent } from "../standalone/standalone.component";
1114
// Vendors
1215
TranslateDirective,
1316
TranslatePipe,
17+
18+
// Mat
19+
FormsModule,
20+
ReactiveFormsModule,
21+
MatSelectModule,
22+
MatFormFieldModule,
1423
],
1524
templateUrl: "./page-content.component.html",
1625
changeDetection: ChangeDetectionStrategy.OnPush,

projects/test-app/src/app/components/standalone/standalone.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ <h2>Simple translations without parameters</h2>
88
<p [translate]="'demo.simple.text-as-attribute'">Should be replaced</p>
99

1010
<p translate>demo.simple.text-as-content</p>
11+
12+
<p>{{ "demo.simple.text-as-pipe-with-params" | translate: { value: "params" } }}</p>
1113
</div>
1214
</div>

projects/test-app/src/app/components/standalone/standalone.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
border: 1px solid var(--mat-sys-outline);
33
border-radius: var(--mat-sys-corner-small);
44
padding: 0 var(--space);
5+
margin-bottom: var(--space);
56
}

0 commit comments

Comments
 (0)