2017-04-07 114 views
0

我想包括我的角度項目2. adminlte模板我放在裏面的node_modulesadminlte,但連接在角index.html.js.css時,它沒有找到他們,我不知道爲什麼是原因。任何人都可以建議我就這個話題的建議?包括adminLTE在Angular2項目

附加代碼和錯誤:

Reference

Error

回答

0

答案是行不通那麼容易。

按照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,請在項目內部的「資產」文件夾內

-1

我假設通過在您的應用程序中包含使用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