I am having trouble with the data binding of {{value}}
. Here is a straightforward example:
app.component.ts
import {Component, OnInit} from "@angular/core";
@Component({
selector: "app",
templateUrl: "./app/app.html"
})
export class AppComponent implements OnInit {
title:string = "aaaaa";
ngOnInit() {
console.log("The application component has been initialized...");
}
}
app.component.html
<section>
<p>Display test.</p>
<nav>
<p>{{title}}</p>
</nav>
</section>
{{title}}
always appears blank. I have checked that the <p>
element is being created in the DOM.