You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,6 +156,34 @@ Yes. Please check this issue: https://github.com/ionic-team/ionic-framework/issu
156
156
157
157
> 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.
158
158
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
+
exportclassExampleComponent {
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
+
159
187
- Why not addIcons in each component?
160
188
161
189
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