-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
I just upgraded from ng2 rc4 with material2 alpha6 to ng2 rc5 with material 2 alpha7-2. A new error pops up on code that worked before when I use md-icon. It may be a bug.
I cannot see the full error text because instead I get Observable_1.Observable.throw is not a function error (the app crashes), with the top lines in the stacktrace being:
MdIconRegistry.prototype.getNamedSvgIcon @angular2-material/icon/icon-registry.js:180:16
MdIcon.prototype.ngOnChanges @angular2-material/icon/icon.js:107:17
If I console.log() the id of the icon sought just above icon-registry.js @ line 180, I see ic_lightbulb_outline_24px. This icon is present in my svg sprite, but it displayed properly before I upgraded today to material 2 alpha 7-2. Here is its section in the svg sprite:
...</svg> <svg viewBox="0 0 24 24" id="ic_lightbulb_outline_24px"><path d="..."/></svg>...
The template:
<md-icon svgIcon="ic_lightbulb_outline_24px"></md-icon>
In my main AppComponent I have
this._iconRegistry.addSvgIconSet('src/icons/sprite.defs.svg');
I've also imported MdIconModule into the main AppModule. What's really puzzling is that
- the same icon from the same sprite file works on other components and
- this worked before the upgrade!
Any ideas?
(cross-posted on StackOverflow)