I have some troubles with setting value to my variable in ngOnInit() function. I have tried to seeing variable in console after setting but I received only "undefined". How to make it work?
export class GalleryComponent implements OnInit {
actualModelType: modelInterface[];
femaleModels: modelInterface[];
constructor(private _femaleModelsService: FemaleModelsService) {
this.actualModel = null;
this.clicked = false;
}
ngOnInit() {
this._femaleModelsService.getFemaleModels()
.subscribe( responseFemaleModelsData => this.femaleModels = responseFemaleModelsData );
this.actualModelType = this.femaleModels;
console.log( this.actualModelType, this.femaleModels );
}
}