I'm currently working on a component that involves some code:
export class AddNewCardComponent {
public concept = [];
constructor(
private _router: Router,
private _empDiscService: empDiscService) {
}
ngOnInit(){
this.concept = this._empDiscService.StoreMaster()
.subscribe((data)=>{
this.concept = data;
});
}
}
The main purpose is to retrieve a variable from the services and store it in my array called "store". However, I encountered an issue where:
type void is not assignable to type any
Here's the snippet of my service code:
import {Injectable} from '@angular/core';
import { Httpprovider } from './httpprovider';
@Injectable()
export class empDiscService{
public storedata = [];
constructor(private _httpprovider: Httpprovider){
}
StoreMaster():Observable<any[]>{
return this._httpprovider.httpReq('http://192.168.1.40:5000/getconcept','GET',null,null).map(res =>{<any[]>res.json()}
};
}