I'm new to Typescript and HTML. I'm building an Angular2 app and I currently have a TypeScript file that looks like this:
import {Http, Headers} from 'angular2/http';
import {Component} from 'angular2/core';
import {CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/common';
import {Router} from 'angular2/router';
import {Routes} from '../routes.config';
@Component({
selector: 'home',
templateUrl: './app/home/home.html',
directives: [CORE_DIRECTIVES, FORM_DIRECTIVES]
})
export class Home {
public jsonResponse: string = "";
constructor(private _http: Http) {
var thisReference = this;
thisReference.getSensors();
}
getSensors() {
this.jsonResponse = "testResponse";
}
}
I'm trying to figure out how to get the value for "jsonResponse" in an HTML file. I've searched but can't find a straightforward way to access the jsonResponse variable - any ideas?