Currently, I am developing a function that retrieves data from an API.
However, the function needs to be called within ngOnInit
and the value should be stored in an array variable.
MyValue: any;
MyValue = MyLocation();
Unfortunately, the MyValue
ends up being null
inside the MyLocation
function.