在angular當中的注入,還有在component中的import、constructor(建構子)等等的,雖然使用上沒什麼大問題,但他實際的邏輯和原理還是沒有很懂,這邊就我在網路上蒐集的資訊和自己的彙整分享出來,…
你喜歡寫程式的什麼時候呢?
Coding雖然都是打程式,但是其實還是有分很多種模式。像是玩css玩樣式,弄出自己覺得很酷的動畫,或是寫功能,這個按鈕按下去會跑出什麼,或是整理成什麼東西最後給使用者用。當然還有資料的處理,資料來要變成什麼型別然後儲存進資料庫然後拿出來後怎樣處理。等等等。
【Angular筆記系列】關於Angular生命週期
生命週期一直都很難搞懂。我覺得拉哈哈
這邊想記錄目前對Angular生命週期的一些心得。
目前專案最常遇到的狀況就是,整個網站由很多的component組合起來,然後按了一個按鈕,每個INPUT到component的資料就會更新。所以常常會需要做動作在「input的資料刷新」的時候,比如說去檢查有沒有資料錯誤,或什麼該顯示什麼不該顯示。這時候我們就可以用ngOnChange,把驗證方法寫在裡面,這樣每次有資料變動時就會觸發。相比於checked,ngOnChange不會在你滑鼠移動或打鍵盤任何…
要學習angular的朋友,應該第一直覺會先從官網看起,我也不例外,這邊將我run tutorail的英雄編輯器的過程記錄下來,做一個分享。