Angular 6 service with interface

前端 未结 4 1294
旧时难觅i
旧时难觅i 2021-01-02 04:00

I am building an application with Angular (6.0.7) and I am trying to create a service with the new:

@Injectable({
  providedIn: \'root\'
})
         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-02 04:27

    You can use something like -

    [{ provide: InterfaceName, useClass: ClassName}]
    

提交回复
热议问题