Skip to content

"Can't resolve all parameters for" when calling deserialize method #34

Open
@pierre03

Description

@pierre03

I want to parse the josn to some classes, but when i called deserialize method in component "content" like:

  let content = {"data" : 10};
  const response = deserialize(SearchResponse, content);

And the SearchResponse is defined as:

export class ResearchResponse{
  data: number;
  constructor(){ this.data = void 0;}
}

I got an error for the component "Menu", in which i have also a class to define all the menus without json data but like this in hard:

this.menus = [
   new Menu(1, 'search');
  new Menu(2, 'result');
]

If i comment the call to deserialize function, the error will disapear.
This is the Error: Uncaught error: Can't resolve all parameters for MenuComponent; (?).
Any one can help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions