-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requiring SASS in Angular 2 components with webpack #219
Comments
Have you tried calling .toString()? As in, I did something similar for stylus, using the css-loader. |
Change the
|
Thank you @davidarnarsson , that works. And @abdulhaq-e I tried implementing your suggested change but it ruined my layout unfortunately. The problem now remains that both styles are being loaded on both pages. The main problem is the background colour, which is different for both components. I have this:
but the Unless you know. Thanks for your help. Mark |
Opened #199 consolidating UI/style related issues. |
closing for #199 |
try require('../sass/signup.scss');
@Component({
selector: 'signup',
directives: [RouterOutlet, RouterLink],
template: require('./signup.component.html')
}) |
YASS! @davidarnarsson, using require('./file.scss').toString() helped. Thanks |
If you don't want to have to write |
Anyone was able to run the test after adding scss files? |
I gave up. I use Bootstrap 3 now, so everything works. |
I founded the solution to run the test (karma) after adding scss files, I added the loader also in the |
Can we have a separate branch for Bootstrap 4? I think it might be useful... |
I am trying to require my SASS in my components, like this:
but my browser is complaining:
EXCEPTION: TypeError: s.replace is not a function
I previously had the require outside of the component definition and it worked fine; but now I have another component I have to put the styles inside the components.
I have the correct loaders going on for SASS:
What am I doing wrong?
The text was updated successfully, but these errors were encountered: