I'm encountering an issue with Angular when trying to use mdIcon in my code. Here is the snippet that's causing trouble:
import {Component} from '@angular/core';
import {MdIcon} from '@angular2-material/icon';
@Component({
selector: 'my-app',
template: `
<md-toolbar>
<md-icon class="demo-toolbar-icon">menu</md-icon>
<span>Default Toolbar</span>
<span class="demo-fill-remaining"></span>
<md-icon>code</md-icon>
</md-toolbar>`,
directives: [MdIcon,MdToolbar],
})
export class AppComponent {}
The error message states:
ORIGINAL EXCEPTION: No provider for MdIconRegistry! Error: DI Exception at NoProviderError.BaseException [as constructor] (exceptions.ts:14) at NoProviderError.AbstractProviderError [as constructor] (reflective_exceptions.ts:53) at new NoProviderError (reflective_exceptions.ts:85) at ReflectiveInjector_._throwOrNull (reflective_injector.ts:844) at ReflectiveInjector_._getByKeyDefault (reflective_injector.ts:873) at ReflectiveInjector_._getByKey (reflective_injector.ts:835) at ReflectiveInjector_.get (reflective_injector.ts:632) at ElementInjector.get (element_injector.ts:19) at DebugAppView._View_AppComponent0.createInternal (AppComponent.template.js:141) at DebugAppView.AppView.create (view.ts:110)
Anyone have insights on what I might be doing incorrectly in this scenario?