components icon indicating copy to clipboard operation
components copied to clipboard

Error Using MdIcon and/or MdIconRegistry

Open griffiti opened this issue 10 years ago • 6 comments

Bug, feature request, or proposal:

I've installed @angular2-material/icon package. I can import MdIconRegistry and MdIcon without errors. But when I add either directive or provider reference, I get the error attached.

What is the expected behavior?

To be able to use the MdIcon directive.

What is the current behavior?

An error is thrown.

What are the steps to reproduce?

Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

2.0.0-rc.1

Is there anything else we should know?

mdicon-error

griffiti avatar Jun 22 '16 08:06 griffiti

I can't reproduce your error in my sample app: https://material2-app.firebaseapp.com/ https://github.com/jelbourn/material2-app

My guess is that you didn't also install @angular2-material/core, which all of the components depend on.

jelbourn avatar Jun 22 '16 18:06 jelbourn

Yes I do have core installed. MdInput, MdButton...everything else works and renders. Just when I bring in MdIcon or MdIconRegistry does the error occur.

griffiti avatar Jun 22 '16 19:06 griffiti

Without seeing your project setup I can't really tell what might be wrong.

jelbourn avatar Jun 22 '16 20:06 jelbourn

I understand. I'm going to do some debugging and if necessary, I'll create a fresh project. Thanks!

griffiti avatar Jun 22 '16 21:06 griffiti

I figured it out. :) I had installed @angular2-material/core package. However, I had left it out in the SystemJS config file! Now everything works properly and I'm able to use MdIcon and MdIconRegistry, and I see icons with the buttons.

systemjs-config

griffiti avatar Jun 23 '16 03:06 griffiti

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.