Skip to content

Latest commit

 

History

History
20 lines (20 loc) · 776 Bytes

File metadata and controls

20 lines (20 loc) · 776 Bytes

Best practices for a clean and performant Angular application

1. trackBy

When an array changes, Angular re-renders the whole DOM tree. But if you use trackBy, Angular will know which element has changed and will only make DOM changes for that particular element.

2. const vs let

3. Pipeable operators

4. Isolate API hacks

5. Subscribe in template

6. Clean up subscriptions

7. Use appropriate operators

8. Lazy load

9. Avoid having subscriptions inside subscriptions

10. Avoid any; type everything;

11. Make use of lint rules

12. Small reusable components

13. Components should only deal with display logic

14. Avoid long methods

15. DRY

16. Add caching mechanisms

17. Avoid logic in templates

18. Strings should be safe