Skip to content

Commit 6139bd1

Browse files
committed
update readme
1 parent 4c9ee9e commit 6139bd1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,34 @@ Yes. Please check this issue: https://github.com/ionic-team/ionic-framework/issu
156156

157157
> You're more than welcome to register them in main.ts or app.component.ts. You can then use them anywhere in your application. However, the initial bundle size may increase because the icons need to be loaded up front.
158158
159+
- Support Unit Test?
160+
161+
Unit test at ChromeHeadless don't read `main.ts`. So, you need to add `addIcons` in each test, or add `addIcons` in `src/test.ts`.
162+
163+
- Support binding icon name?
164+
165+
No, and we do not plan to support this program. For example, this kind of code is difficult to follow until it is displayed.
166+
167+
```ts
168+
@Component({
169+
selector: 'app-example',
170+
template: `
171+
<ion-icon [name]="iconName"></ion-icon>
172+
`,
173+
})
174+
export class ExampleComponent {
175+
iconName = 'add';
176+
177+
ionViewWillEnter() {
178+
setTimeout(() => {
179+
this.iconName = 'remove';
180+
}, 1000);
181+
}
182+
}
183+
```
184+
185+
If you are doing this kind of complex processing, please import manually.
186+
159187
- Why not addIcons in each component?
160188

161189
This is to minimize diffs by libraries. I did not like to have every component change on every run. I wanted to keep the diff as small as possible.

0 commit comments

Comments
 (0)