Retrospective #1 - Tuong-Nguyen/Angular-D3-Cometd GitHub Wiki

Technical points:

  • Input property of component: object or array; Object changes -> view is not re-rendered.
    • vs. ngFor: view is rendered.
  • Coding standard:
    • private member variable: prefix _. Reason: getter/setter.
    • add modifier (public, protected, private) explicitly
  • Presentational component and Container component: There is no need to create a Container for each presentational component.
  • Playground: Module for presentational components.
  • Playground: configure host-component. (https://github.com/Tuong-Nguyen/Angular-D3-Cometd/wiki/Angular-Playground)
  • Unit Test component: Mock object - instead of defining a MockClass, use: jasmine.createSpyObject('name', ['array', 'method']
  • Container - Presentational Pattern: To minimize the logic in Presentational component, Presentational component only accept valid @Input. Container has responsibility to ensure the @Input set to Presentational component valid. Ex: Presentational component has @Input Dashboard: Dashboard[] - this should be null or undefined. The container must ensure the data input to Presentational component is correct; ie: not null and not undefined.
  • ngrx-store: Observable is preferred to Promise. Therefore, do not use async - await.