包括adminLTE在Angular2项目

问题描述:

我想包括我的角度项目2. adminlte模板我放在里面的node_modulesadminlte,但连接在角index.html.js.css时,它没有找到他们,我不知道为什么是原因。任何人都可以建议我就这个话题的建议?包括adminLTE在Angular2项目

附加代码和错误:

Reference

Error

答案是行不通那么容易。

按照AdminLTE网站 “https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html

Is there an integration guide for PHP frameworks such as Yii or Symfony?

Short answer, no. However, there are forks and tutorials around the web that provide info on how to integrate with many different frameworks. There are even versions of AdminLTE that are integrated with jQuery ajax, AngularJS and/or MVC5 ASP .NET.

,所以你可以检查此

但我想你可以添加 “引导,DIST,包”如果您正在使用角度CLI,请在项目内部的“资产”文件夹内

我假设通过在您的应用程序中包含使用AdminLTE.css文件的模板。

为了做到这一点,你需要导入.css文件在你component.ts文件,如下:

@Component({ 
    moduleId: module.id, 
    selector: 'dashboard', 
    templateUrl: 'dashboard.component.html', 
    styleUrls: ['bower_components/adminLTE/dist/css/AdminLTE.min.css'] 
}) 

PS:请确保该路径有效

一旦指定styleUrl后,我们将能够访问Admin LTE的CSS选择器或dashboard.component.html文件中的任何其他模板。

有几种方法可以添加CSS到你的角项目,请参考以下链接: https://scotch.io/tutorials/all-the-ways-to-add-css-to-angular-2-components

一个有趣的方法是通过角-CLI如下git的枢纽环节 https://github.com/ahmadalibaloch/Angular-AdminLTE

我发现添加github中的AdminLTE的Angular 2端口。你可能想看看这个:

https://github.com/csotomon/Angular2-AdminLTE