Skip to content

Commit 20f519c

Browse files
docs(searchbar): update angular to standalone (#3960)
1 parent 24c2c85 commit 20f519c

38 files changed

+388
-28
lines changed
File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```ts
2+
import { Component } from '@angular/core';
3+
import { IonSearchbar } from '@ionic/angular/standalone';
4+
5+
@Component({
6+
selector: 'app-example',
7+
templateUrl: 'example.component.html',
8+
styleUrls: ['example.component.css'],
9+
imports: [IonSearchbar],
10+
})
11+
export class ExampleComponent {}
12+
```

static/usage/v7/searchbar/basic/index.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@ import Playground from '@site/src/components/global/Playground';
33
import javascript from './javascript.md';
44
import react from './react.md';
55
import vue from './vue.md';
6-
import angular from './angular.md';
6+
7+
import angular_example_component_html from './angular/example_component_html.md';
8+
import angular_example_component_ts from './angular/example_component_ts.md';
79

810
<Playground
911
version="7"
10-
code={{ javascript, react, vue, angular }}
12+
code={{
13+
javascript,
14+
react,
15+
vue,
16+
angular: {
17+
files: {
18+
'src/app/example.component.html': angular_example_component_html,
19+
'src/app/example.component.ts': angular_example_component_ts,
20+
},
21+
},
22+
}}
1123
src="usage/v7/searchbar/basic/demo.html"
1224
size="300px"
1325
/>
File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
```ts
2+
import { Component } from '@angular/core';
3+
import { IonSearchbar } from '@ionic/angular/standalone';
4+
5+
import { addIcons } from 'ionicons';
6+
import { trash } from 'ionicons/icons';
7+
8+
@Component({
9+
selector: 'app-example',
10+
templateUrl: 'example.component.html',
11+
styleUrls: ['example.component.css'],
12+
imports: [IonSearchbar],
13+
})
14+
export class ExampleComponent {
15+
constructor() {
16+
/**
17+
* Any icons you want to use in your application
18+
* can be registered in app.component.ts and then
19+
* referenced by name anywhere in your application.
20+
*/
21+
addIcons({ trash });
22+
}
23+
}
24+
```

static/usage/v7/searchbar/cancel-button/index.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@ import Playground from '@site/src/components/global/Playground';
33
import javascript from './javascript.md';
44
import react from './react.md';
55
import vue from './vue.md';
6-
import angular from './angular.md';
6+
7+
import angular_example_component_html from './angular/example_component_html.md';
8+
import angular_example_component_ts from './angular/example_component_ts.md';
79

810
<Playground
911
version="7"
10-
code={{ javascript, react, vue, angular }}
12+
code={{
13+
javascript,
14+
react,
15+
vue,
16+
angular: {
17+
files: {
18+
'src/app/example.component.html': angular_example_component_html,
19+
'src/app/example.component.ts': angular_example_component_ts,
20+
},
21+
},
22+
}}
1123
src="usage/v7/searchbar/cancel-button/demo.html"
1224
size="250px"
1325
/>
File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
```ts
2+
import { Component } from '@angular/core';
3+
import { IonSearchbar } from '@ionic/angular/standalone';
4+
5+
import { addIcons } from 'ionicons';
6+
import { trashBin } from 'ionicons/icons';
7+
8+
@Component({
9+
selector: 'app-example',
10+
templateUrl: 'example.component.html',
11+
styleUrls: ['example.component.css'],
12+
imports: [IonSearchbar],
13+
})
14+
export class ExampleComponent {
15+
constructor() {
16+
/**
17+
* Any icons you want to use in your application
18+
* can be registered in app.component.ts and then
19+
* referenced by name anywhere in your application.
20+
*/
21+
addIcons({ trashBin });
22+
}
23+
}
24+
```

static/usage/v7/searchbar/clear-button/index.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@ import Playground from '@site/src/components/global/Playground';
33
import javascript from './javascript.md';
44
import react from './react.md';
55
import vue from './vue.md';
6-
import angular from './angular.md';
6+
7+
import angular_example_component_html from './angular/example_component_html.md';
8+
import angular_example_component_ts from './angular/example_component_ts.md';
79

810
<Playground
911
version="7"
10-
code={{ javascript, react, vue, angular }}
12+
code={{
13+
javascript,
14+
react,
15+
vue,
16+
angular: {
17+
files: {
18+
'src/app/example.component.html': angular_example_component_html,
19+
'src/app/example.component.ts': angular_example_component_ts,
20+
},
21+
},
22+
}}
1123
src="usage/v7/searchbar/clear-button/demo.html"
1224
size="250px"
1325
/>

static/usage/v7/searchbar/debounce/angular/example_component_html.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
<ion-searchbar [debounce]="1000" (ionInput)="handleInput($event)"></ion-searchbar>
33

44
<ion-list>
5-
<ion-item *ngFor="let result of results">
5+
@for (result of results; track result) {
6+
<ion-item>
67
<ion-label>{{ result }}</ion-label>
78
</ion-item>
9+
}
810
</ion-list>
911
```

0 commit comments

Comments
 (0)