Primeng
建立專案
選擇第二個SCSS
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
開啟專案(在專案資料夾中)
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
安裝Angular Cli
安裝Angular cdk
查看安裝的Cli版本
新增primeflex > https://www.primefaces.org/primeflex/setup
匯入BrowserAnimationsModule到app.module.ts
安裝Primeng > https://primeng.org/installation
匯入primeng樣式(如下圖,記得加",")
貼在angular.json的styles裡面
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
共享模組
-
在app資料夾下新增shared module
(右鍵app資料夾->選擇Generate a module 或
右鍵app資料夾->選擇Generate another schematic->module)
-
在shared資料夾下新增primeng module
新增完成後如下
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
-
import primeng
並在primeng資料夾中新增primeng module
exports貼在import下面(如下圖,記得加",")
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 到shared.module.ts 匯入 primeng
- 到app.modules.ts 匯入共享模組 (shared module)
- 建立toolbar component
- toolbar & sidebar(toolbar.component.html)
- 樣式設定 ( toolbar.component.scss )
( toolbar.component.ts )
( app.component.html ) 全部刪掉改成以下
新增一個component
右鍵->generate a component->名稱(自定義表格我用table)
- 檢查app.module.ts有無自動import component
- 記得要在routing import table component,如下圖所示

建立api
https://medium.com/itsems-frontend/api-是什麼-restful-api-又是什麼-a001a85ab638
- 建立api servic:新增api資料夾->右鍵->generate a service->名稱(api)
- 匯入HTTP模組、定義HttpClient
懶加載(這個我一直報錯
學長姐給的參考資料
操作小技巧
html基本語法:https://www.w3schools.com/html/default.asp
css基本語法: https://www.w3schools.com/css/default.asp
boostrap:https://getbootstrap.com/docs/5.3/layout/columns/
打div.class
自動生成以下
報錯處理
- p-toorbar

在app.module.ts加上CUSTOM_ELEMENTS_SCHEMA
,如下

- $event

煩欸,我解決不了,超生氣! 