recently having to refactor a complex component in angular, some experience I think could be beneficial for the future, so take a note here:
- Bind child component’s property directly
- If not direct binding, then use viewmodel method to bind (easier to unit test also)
- Smuggle some simple logic in the mark up to avoid testing.
- Reference to child component with interface to achieve polymorphism
- Use [hidden] to avoid the
Expression has changed after it was checked
From <https://blog.angular-university.io/angular-debugging/>
Or set binding value after delay()
6. service class can return observable, can be piped and subscribed, but inside component we can convert toPromise() and do async/await for better readability, catch exception and return null for the promise<T>.