HaithemMosbahi / ngx-avatar

Universal avatar component for angular 2+ applications makes it possible to fetch / generate avatar from different sources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isSource gives TypeError in Internet Explorer 11

fredriksundstrom opened this issue · comments

We have quite a few users in Internet Explorer 11 still and we started using ngx-avatar recently. We detected that it throws a typeerror on the isSource method:

return this.avatarSources.includes(source as AvatarSource);

We use the initials version only.

It pauses loading of polyfills which is a big deal with IE so ngx-avatar (or an error we did with ngx-avatar) is causing some issues. :)

TypeError: Object doesn't support property or method 'includes' at AvatarService.prototype.isSource (http://192.168.20.61:4200/vendor.js:173933:5) at AvatarComponent.prototype.ngOnChanges (http://192.168.20.61:4200/vendor.js:174083:9) at checkAndUpdateDirectiveInline (http://192.168.20.61:4200/vendor.js:83556:5) at checkAndUpdateNodeInline (http://192.168.20.61:4200/vendor.js:84824:9) at checkAndUpdateNode (http://192.168.20.61:4200/vendor.js:84786:5) at debugCheckAndUpdateNode (http://192.168.20.61:4200/vendor.js:85420:1) at debugCheckDirectivesFn (http://192.168.20.61:4200/vendor.js:85380:9) at Anonymous function (Function code:34:5) at debugUpdateDirectives (http://192.168.20.61:4200/vendor.js:85372:1) at checkAndUpdateView (http://192.168.20.61:4200/vendor.js:84768:1)

We use it just like this:

<ngx-avatar size="42" [name]="session.user.Name"></ngx-avatar> and <ngx-avatar size="48" src="{{ data.senderLogoImage }}"></ngx-avatar>

Any help would be appreciated!

That makes perfect sense, have you tried loading a polyfill on IE?