I have created a project using angular-cli
which contains AppComponent as follows:
import { Component } from \'@angular/core\';
It appears that the way to do this now is to set the responseType when you make your request. HttpClient-Requesting non-JSON data `
@Component({
selector: 'my-template',
template: ''
})
export public class MyTemplate {
private myTemplate: any = "";
@Input() url: string;
constructor(http: Http) {
http.get("/path-to-your-jsp", { responseType: 'text' })
.subscribe(
(data: string) => {
this.myTemplate = html;
}
);
}
}
`