File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ import { DaffioDocsService } from '../services/docs.service';
2626} )
2727export class DocsResolver < T extends DaffDoc = DaffDoc > {
2828
29- constructor ( private docService : DaffioDocsService < T > , private router : Router ) { }
29+ constructor ( private docService : DaffioDocsService , private router : Router ) { }
3030
3131 resolve ( route : ActivatedRouteSnapshot , state : RouterStateSnapshot ) : Observable < T > {
3232 return this . docService
3333 //remove any route fragment and initial slash from the route.
34- . get ( daffUriTruncateLeadingSlash ( daffUriTruncateQueryFragment ( state . url ) ) )
34+ . get < T > ( daffUriTruncateLeadingSlash ( daffUriTruncateQueryFragment ( state . url ) ) )
3535 . pipe (
3636 take ( 1 ) ,
3737 catchError ( ( ) => {
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ import { Observable } from 'rxjs';
22
33import { DaffDoc } from '@daffodil/docs-utils' ;
44
5- export interface DaffioDocsServiceInterface < T extends DaffDoc = DaffDoc > {
6- get ( path : string ) : Observable < T > ;
5+ export interface DaffioDocsServiceInterface {
6+ get < T extends DaffDoc = DaffDoc > ( path : string ) : Observable < T > ;
77}
Original file line number Diff line number Diff line change @@ -19,14 +19,13 @@ import {
1919@Injectable ( {
2020 providedIn : 'root' ,
2121} )
22- export class DaffioDocsService < T extends DaffDoc = DaffDoc > implements DaffioDocsServiceInterface < T > {
23-
22+ export class DaffioDocsService implements DaffioDocsServiceInterface {
2423 constructor (
2524 @Inject ( DaffioAssetFetchService ) private fetchAsset : DaffioAssetFetchServiceInterface ,
2625 @Inject ( DAFFIO_DOCS_PATH_TOKEN ) private docsPath : string ,
2726 ) { }
2827
29- get ( path : string ) : Observable < T > {
28+ get < T extends DaffDoc = DaffDoc > ( path : string ) : Observable < T > {
3029 return this . fetchAsset . fetch < T > ( `${ this . docsPath } /${ crossOsFilename ( path ) } .json` ) ;
3130 }
3231}
You can’t perform that action at this time.
0 commit comments