2
votes

I'm facing a problem using angular 4

There is no directive with "exportAs" set to "ngModel" ("" name="fullname" type="text" required maxlength="30" [(ngModel)="model.fullname" [ERROR ->]#fullname="ngModel">

component.html

<input class="form-control" name="fullname" type="text" required maxlength="30"
 [(ngModel)="model.fullname" #fullname="ngModel">

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import {AppRoutingModule} from './app-routing.module';

import { ImageUploadModule } from 'angular2-image-upload';

import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { HomeComponent } from './home/home.component';
import { AddComponent } from './add/add.component';
import { EditComponent } from './edit/edit.component';

@NgModule({
  declarations: [
    AppComponent,
    NavbarComponent,
    HomeComponent,
    AddComponent,
    EditComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    ImageUploadModule.forRoot(),
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
1

1 Answers

3
votes

You have [(ngModel)="model.fullname" but you are never closing the square bracket it should be [(ngModel)]="model.fullname"