The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
res : any[];
constructor(http: HttpClient) {
http.get('http://jsonplaceholder.typicode.com/posts')
.subscribe(response => {
this.res = response;
});
ngOnInitinstead