不能将类型“ X”分配给类型“操作”

时间:2019-06-11 08:31:34

标签: angular typescript

类型“ Operation.GetList”不可分配给类型“ Operation”。

这是我的错误

private async getPermissions()  {
        const res = await this._entityRepository.sendRequest(this._globals.apiUrl, {
            key: 'Permission',
            operation: Operation.GetList

        });

错误是类型 'Operation.GetList'不能分配给'Operation'.ts(2322) data-request.model.ts(5,12):预期的类型来自属性“ operation”,该属性在此处声明为“ DataRequestModel”类型

这是我的data-request.model.ts

import { Operation } from '../enums';

export class DataRequestModel {
    public key?: string;
    public operation: Operation;
    public json?: string;
    public predicate?: string;
    public includes?: Array<string>;
    public page?: number;
    public pageSize?: number;
    public orderColumn?: string;
    public orderDirection?: string;
    public startIndex?: number;
    public count?: number;
    public query?: string;
    public ignoreQueryFilters?: boolean;
}

0 个答案:

没有答案