无法将Observable <UserDomainList>分配给类型'()=> Observable <UserDomainList>'

时间:2019-07-26 08:47:40

标签: angular angular7 angular2-observables angular-unit-test

我正在尝试在服务中模拟如下功能:

   .mock(WelcomeScreenService, { loadUserPreferences: of(mockRes) })

完整代码:

我的回复(API)

   {"overviewPreferences":{"selectedRole": 
[{"code":"Practitioner","name":"ADMIN"}],"selectedDomainList": 
[{"code":"14L","name":"Recruitment"},{"code":"5L","name":"Time"}]}};

我的界面,

     export interface UserDomainList {
       overviewPreferences: UserDomainsList;
     }

    export interface UserDomainsList {
     selectedDomainList: Code[];
     selectedRole: Code[];
     aoId?: string;
     }

     export interface Code {
     code: string;
     name: string;
     }

出现标题中的错误。

0 个答案:

没有答案