0

Id like to:

npm install some-css-component

And then from the corresponding angular 2 component:

@Component({
    selector: 'some-component',
    styleUrls: [ 'some-css-component, ...' ]
})

Is there a way to configure the angular build to resolve the npm some-css-component?

1
  • styleUrls has to point to the relative location of the css. you'll have to figure the relative path from your ts file to the node_modules/some-css-component/path/to/file.css Commented Apr 27, 2017 at 18:53

1 Answer 1

1

You can use CSS imports like in global styles:

@Component({
    selector: 'some-component',
    styles: [
        '@import "/node_modules/some-css-component/dist/css/styles.css"'
    ],
})
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.