三月 2024
 123
45678910
11121314151617
18192021222324
25262728293031

彙整

Kendo UI for Angular

【課程主題】:Kendo UI for Angular

【課程內容】:

範例網站http://webnas.bhes.ntpc.edu.tw/chiubor/ng-demo-kendoui/

範例網站程式下載:ng-demo-kendoui

  • 下載解壓縮後,請至專案資料夾中,下達下列指令:
    • npm install => 重建 node_modules
  • 安裝後若仍有缺元件:
    • npm install –save 元件名稱

注意事項:

  • npm install 完成後,會出現下列警告訊息:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

警告原因是因為此元件僅適用於 darwin 作業系統,不適用於 Windows 作業系統,故予以跳過不安裝。

但若有其他元件相依於此元件,將導致其他元件無法正常安裝設定。因此最好是強制將其安裝,否則此訊息及此問題會不斷重演。

強制安裝指令:

npm install --force fsevents


課程相關教材:

開發環境與工具:

更新 Node.js, npm, Angular CLI

Node.js 重新安裝即可

npm i -g npm

npm unstall -g @angular/cli

npm i -g @angular/cli

網站佈署:

ng build --prod --base-href /ng-demo-kendoui/

將專案目錄下的 dist 資料夾整個複製到網站根目錄下(或另建置虛擬目錄),將 dist 更名為 ng-demo-kendoui

重點提示:

  • index.html 中的 base 修改成
    <base href="/VirtualDirectory/">
  • 或是在 build 的時候使用
    ng build --prod --base-href /VirtualDirectory/
    這個帶有 --base-href 參數的指令

Angular 學習資源

Comments are closed.