This is the module I am working with:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
@NgModule({
imports: [CommonModule, FormsModule, BrowserModule, ReactiveFormsModule],
declarations: [FooterComponent],
exports: [FooterComponent],
providers: []
})
export class FooterModule { }
Here is the component I have created:
import { Component } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'FooterComponent',
templateUrl: 'footer.component.html'
})
export class FooterComponent {
email: string = "";
constructor() {
console.log("footer!");
this.email = "test";
}
}
Displayed below is the html code:
<div class="form-group col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2">
<input class="form-control" type="email" value="" placeholder="Email address" [(ngModel)]="email">
</div>
I want to establish a two-way binding between the model email and the view.
The error I am encountering in the console is:
Unhandled Promise rejection: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input'. ("
*Feel free to ask if you need any additional files or information