Compilation Error Angular Interface 2

0

I ask for your help because I have created an interface with a boolean field and it is generating a compilation error which I have searched for and I do not know how to solve

Interface:

export interface Empresa {
       key$ ? : string;
       nombre : string;
       nit : number;
        estado : boolean;
}

Componente:

empresa : Empresa = {
  nombre: "Mi Empresa",
  nit   : 123245566577,
  estado: true
};

Error generated : src / app / components / companies / companies.component.ts (16,5): Type '{name: string; nit: number; state: boolean; } 'is not assignable to type' Company '. Object literal may only specify known properties, and 'status' does not exist in type 'Company'.

    
asked by Gdaimon 15.04.2017 в 19:36
source

1 answer

0

Try to declare your property state of type any: estado: any; and see if it is a problem of what you are sending or something else, I was going to comment but I still do not have enough reputation haha.

    
answered by 15.04.2017 в 20:17