Why is the input binding not working? I have taken the framework code created by IntelliJ and have replaced the default app
component with my component my-para
. Following is the code snippet.
index.html
<body>
<my-para [paratext]="say something"></my-para>
</body>
paragraph.component.ts
import {Component, Input } from "@angular/core";
@Component({
selector: 'my-para',
inputs: ['paratext'],
template:`
<p>Hello {{this.paratext}}</p>
`
})
export class MyParaComponent {
@Input() paratext: string;
}
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {MyParaComponent} from './paragraph.component'
@NgModule({
declarations: [
MyParaComponent,
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [MyParaComponent]
})
export class AppModule { }
I see only "hello" but not "hello say something"