Skip to content

Instantly share code, notes, and snippets.

@ghetolay
Last active May 10, 2019 12:15
Show Gist options
  • Save ghetolay/c25f95d9e86928c56a33f05e4658740e to your computer and use it in GitHub Desktop.
Save ghetolay/c25f95d9e86928c56a33f05e4658740e to your computer and use it in GitHub Desktop.

##feature

  1. @Until() : less restrictive @Host()
  2. ngStyle allows array as value so we can do 'padding.px': [10 20]
  3. Define pure function inside component to act like local Pipe. avoid the hassle to create Pipe when it's non-reusable/component specific.
  4. Typings of RendererV2.listen() should be false | void done => boolean | void
  5. Provide non-singleton service on modules (maybe breaking the design and purpose of injection). when we want service tied to component we need to provide it inside @Component({ providers: )} This is a bit boilerplate and error prone because if you inject the service and forget to provide it on your component you may get one of the parent's instance. Would be good to add the possibility to define per-component service at module which will create a new instance for each injection (not meant to be shared with children or else). Current need if for extending component so if something comes up in the meantime it won't be needed
  6. Define which controls affect a validator. ex: FormGroup with controls A, B, C, we should be able to define a Validators that validates just A & B and doesn't get triggered when C updates.
  7. We should be able to use const enum inside template.
  8. Use of lambda for loadChildren on cli makes nested loadChildren fail.
  9. Allow services to fail instantiation: catch throw and return null.
  10. path :'**' doesn't match root with aux outlet. ex: /(aux: 1) doesn't match while / and /home(aux: 1) match.
  11. possibility to set parent global style inside encapsulated .ps my-cmp[ng-content012] { } maybe with that syntax ::ng-deep.ps :host { } :host-context ex: :host-context(.ps) { }.
  12. wrong typings for UrlMatcher, function can return UrlMatchResult or any falsy value
  13. DefaultKeyValueDiffer typings differ from the interface KeyValueDiffer. Should both be the same (like DefaultKeyValueDiffer imo).
  14. QueryList injected with ViewChildren should be initialized as an empty list on constructor and be filled later.
  15. add a boolean to ngAfterViewChecked and ngAfterContentChecked that tells if a change was detected or not.
  16. APP_INITIALIZER, docs doesn't mention we can return a Promise. Also why just Promise and not Observables ??

##Docs

  1. Explaination of why we shouldn't create object on ngTemplateOutlet context input. Not official anymore since ngTemplateOutlet got reworked on v5 with a differ, now it's only my personal opinion.
  2. Possibility to escape placeholder chars in DatePipe by surrounding them with quote '. ex HH'h'mm to print 10h45.
  3. How to provide a service with providedIn without using Injectable annotation (cause service is used on backend for exemple).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment