In this code, can someone explain the rule of thumb, why / when there is a need, what, as it seems to me, is called a wrapping expression inside Typescript? that is, '(' ')' in <[Parent, (Children [])]> .
If, for example, I determined the type of the tuple and used what the solution implements / the method of signing the main code, will you still need a '(' ')' wrapped around the Children array?
Are there other scripts in Typescript / Angular where the expression wrapper also happens?
- Is Angular specification? For example, '?' type safe navigator I learned about Angular Typescript decoration, which is not yet part of the language. See here and here and here .
type parentChildTuple = [Parent, Children[] ]
- against
type parentChildTuple = [Parent, (Children[]) ]
import { Injectable } from '@angular/core'; import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; @Injectable() export class DataComponentResolver implements Resolve<[Parent, (Children[])]> { constructor() { } resolve( route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<[Parent, (Children[])]> { } }
angular tuples typescript angular2-routing
Jgfmk
source share