angular2-jsonapi icon indicating copy to clipboard operation
angular2-jsonapi copied to clipboard

Can't resolve all parameters for ... This will become an error in Angular v6.x

Open cguilhermef opened this issue 7 years ago • 3 comments

Warning: Can't resolve all parameters for Activities in src/app/core/models/activities.model.ts: ([object Object], ?). This will become an error in Angular v6.x

I'm using Angular CLI 1.6.6 and Angular 5.2.2. This warning occurs running build with -aot option. I see the JsonApiModel implementation and his constructor receive two parameters that are omited when I extend it.

I think that I need to write the child class constructor with super(), suppling with the same kind of parameters. But... how?

cguilhermef avatar Feb 15 '18 17:02 cguilhermef

~I found this workaround - maybe is not a workaround, but the correct way - to extend and avoid the warning~

@Injectable()
@JsonApiModelConfig({
  type: 'activities'
})
export class Activities extends JsonApiModel {
  constructor(
    datastore: JsonApiDatastore,
    data: any
  ) {
    super(datastore, data);
  }
  @Attribute()
  name: string;

  @Attribute()
  active: boolean;
}

But I'm not sure about this solution. Can anybody help me?

cguilhermef avatar Feb 15 '18 17:02 cguilhermef

Hey men? Can somebody help-me? This issue still exist on 6.1.1-beta

cguilhermef avatar Sep 13 '18 14:09 cguilhermef

Still exist on 6.1.2...

cguilhermef avatar Feb 26 '19 14:02 cguilhermef