Msg: ERROR CONTEXT [object Object]

Hello,

I tried all day to debug my app, which work perfectly on browser running, but which doesn’t work on Android Studio.

I have this error message :

Msg: ERROR CONTEXT [object Object]

Which refers to this var :

autocomplete: {input : string,
                 types: string[]};

ngOnInit(){
    this.autocomplete = { input: '', types: ['(regions)'] };
}

If i trie to console.log(autocomplete) it returns ‘undefined’

Do someone know how to fix this error ?

Thanks in advance.

ngOnInit is too late to initialize properties that are referenced from templates. Do it at the point of instantiation instead, or in the constructor if injected friends are needed.

1 Like

Thanks it worked with initializing at the point of instantiation !