Angular SPI Notes
Local Storage to hold the token
to persist the token, local storage is used.
Parent-Child Bindings
@Input - to pass values from parent to child
@Output - to make values from the child available to the parent (event callback)
Typescript tips
Shorthand for an if statement
>!!variable
is equivalent to if variable == null then false else true (like ?? in C#)
Error Handling
Server side - Globally handle exceptions and return as 500 errors. This saves having to add try catches around every controller method.
Client side - Write an error.interceptor that can bee added as a provider. This will intercept the http request and emits error notifications.
Comments
Post a Comment