0

I'm trying to use an external library in my Angular2 application (https://justindujardin.github.io/ng2-material/)

  1. I npm installed the package
  2. I imported directives in my TS file

And then it is not working, I have the following error :

system.src.js:4935 GET http://localhost:5000/ng2-material/all 404 (Not Found)

It seems to be a SystemJS error, but what can I do to make the directives working?

2
  • Does your config.js have map: {"ng2-material":"node_modules/ng2-material"}? Commented Apr 5, 2016 at 14:07
  • yes it have but it cannot resolve the 'All' Commented Apr 5, 2016 at 14:55

1 Answer 1

1

You need to install the ng2-material library using NPM and then configure it within your SystemJS configuration:

<script>
  System.config({
    defaultJSExtensions: true,
    packages: {
      app: {
        format: 'register',
        defaultExtension: false
      }
    },
    map: {
      'ng2-material': 'node_modules/ng2-material'
    }
  });
</script>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.