Lye*_*UKH 3 javascript css angular-cli angular-components angular
我在另一个父应用程序的子目录中有一个 Angular 5 应用程序。
父应用程序是一组JSP,以及其他AngularJs应用程序...等等。
我想做的是将父应用程序中的 CSS 文件包含到 Angular 5 应用程序的组件中。
@Component({
selector: 'app-my-form',
templateUrl: './my-form.component.html',
styleUrls: [....] //Here
})Run Code Online (Sandbox Code Playgroud)
是否可以 ?
我查看了这个问题:Load external css style into Angular 2 Component 已经问过,但它与我的情况不符。
感谢您的帮助
请尝试以下操作:
@Component({
selector: 'app-my-form',
templateUrl: './my-form.component.html',
styleUrls: ['my-form.css']
})
Run Code Online (Sandbox Code Playgroud)
您的文件将是一个 SCSS 文件:myform.scss.
然后你可以导入外部 css 文件,如下所示:
@import "my-external-stylesheet.css"; // this on the top of `my-form.scss`
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19515 次 |
| 最近记录: |