I have created an api in WebAPI as below.
public HttpResponseMessage Get() { var response = Request.CreateResponse(HttpStatusCode.OK); r
Put the console.log inside the data function.
console.log
Could you try like this.
export class AppComponent implements OnInit { data2: String; constructor(private s: DemoService){} ngOnInit(){ this.s.GetHttpData().subscribe(data=>{ this.data2=data; console.log("Http call completed: "+this.data2) }); }