Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  123] [ 7]  / answers: 1 / hits: 17905  / 6 Years ago, fri, april 13, 2018, 12:00:00

I have an Angular 5 application in a subdirectory of another parent application.



The parent application is a set of JSP, and other angularJs applications... etc.



What I'm trying to do is include a CSS file, from this parent application, into a component of the Angular 5 application.





@Component({
selector: 'app-my-form',
templateUrl: './my-form.component.html',
styleUrls: [....] //Here
})





Is it possible ?



I looked at this question : Load external css style into Angular 2 Component
already asked, but it does not correspond to my case.



Thanks for your help


More From » css

 Answers
4

In the .angular-cli.json file of your child application look for the styles property of your app. Add the path to your parent CSS in there.



Here is an example of the JSON config.



 apps: [
{
styles: [
../../../../apec-template-bootstrap-responsive/src/main/resources/css/old-apec.css,
styles.css
],
}
],


This should give your child application any style you require from the parent.


[#54676] Tuesday, April 10, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
myrap

Total Points: 407
Total Questions: 105
Total Answers: 109

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
myrap questions
Tue, Feb 8, 22, 00:00, 2 Years ago
Wed, Jan 15, 20, 00:00, 4 Years ago
Thu, Oct 24, 19, 00:00, 5 Years ago
Thu, Oct 3, 19, 00:00, 5 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;