Skip to content

Commit 3070ef7

Browse files
committed
refactor(icon-service): make platformUtil optional
1 parent 0d35d1d commit 3070ef7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/igniteui-angular/src/lib/icon/icon.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class IgxIconService {
5959
) {
6060
this.iconLoaded = this._iconLoaded.asObservable();
6161

62-
if(this._platformUtil.isBrowser) {
62+
if(this._platformUtil?.isBrowser) {
6363
this._domParser = new DOMParser();
6464
}
6565
}
@@ -194,7 +194,7 @@ export class IgxIconService {
194194
private cacheSvgIcon(name: string, value: string, family = this._family, stripMeta: boolean) {
195195
family = !!family ? family : this._family;
196196

197-
if (this._platformUtil.isBrowser && name && value) {
197+
if (this._platformUtil?.isBrowser && name && value) {
198198
const doc = this._domParser.parseFromString(value, 'image/svg+xml');
199199
const svg = doc.querySelector('svg') as SVGElement;
200200

0 commit comments

Comments
 (0)