2020.08.30
原始文章
Why do we have Dependency Injection in web development
在使用 OOP 語言開發客戶端和伺服器端的應用程式時,使用 DI 這種設計模式已經是開發的一部分。
DI 是一種讓 class 和其依賴達成控制反轉 (IoC) 的 的技巧。
引用自 MDN :
2020.08.16
原始文章
Going Renderless in Angular: All of the Functionality, None of the Render
無渲染元件 (Renderless Components) 指的是不渲染任何畫面的元件。
這種元件的職責在於提供可重用的功能性。
在 Vue.js 中有 Renderless Components。
2020.07.27
原始文章
Make the most of Angular DI: private providers concept
我們可以在 app 中傳遞任何資料,並且在任何層級轉換資料以及替換資料。
所以我們可以藉由清楚的資料流以及鬆耦合來讓架構較為簡單並且更有彈性。
這也會讓測試以及替換 dependencies比較容易。
neuxshermanshen changed 5 years agoView mode Like 5 Bookmark
2020.05.22
原始文章
Why you should never use function calls in Angular template expressions
Angular 範本很棒並且極為強大。
藉著使用結構型指令和屬性綁定,我們能夠用非常乾淨的語法創造出非常複雜的畫面。
<ng-container *ngIf="isLoggedIn">