ERROR Error: Uncaught (in promise): Error: Template parse errors:
Can't bind to 'files' since it isn't a known property of 'ngfFormData'. ("
<button *ngIf="files" (click)="uploadFiles(files)">send files</button>
<ngfFormData [ERROR ->][files]="files" [(FormData)]="resume" postName="file"></ngfFormData>
<ngfUploadStatus [(percent)"): ng:///ApplyModule/DetailsComponent.html@60:17
Can't bind to 'FormData' since it isn't a known property of 'ngfFormData'. ("on *ngIf="files" (click)="uploadFiles(files)">send files</button>
<ngfFormData [files]="files" [ERROR ->][(FormData)]="resume" postName="file"></ngfFormData>
<ngfUploadStatus [(percent)]="uploadPercent"): ng:///ApplyModule/DetailsComponent.html@60:33
'ngfFormData' is not a known element:
1. If 'ngfFormData' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<button *ngIf="files" (click)="uploadFiles(files)">send files</button>
[ERROR ->]<ngfFormData [files]="files" [(FormData)]="resume" postName="file"></ngfFormData>
I've pretty much copied and pasted from the project README.
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
// import { Logger } from 'angular2-logger/core';
import { rootRouterConfig } from './app.routes';
import { AppCommonModule } from './components/common/app-common.module';
import { AppComponent } from './app.component';
import { RoutePartsService } from './services/route-parts/route-parts.service';
import { NavigationService } from './services/navigation/navigation.service';
import { AuthService } from './services/auth/auth.service';
import { AccountAPI, JobOpeningAPI } from './serverCalls';
import { ngfModule } from 'angular-file';
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
AppCommonModule,
ngfModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
RouterModule.forRoot(rootRouterConfig, { useHash: false })
],
declarations: [ AppComponent ],
providers: [
RoutePartsService,
NavigationService,
AuthService,
AccountAPI,
JobOpeningAPI
// Logger,
],
bootstrap: [AppComponent]
})
export class AppModule { }
import { Component, OnInit } from '@angular/core';
// import { ActivatedRoute, Router } from '@angular/router';
import { HttpEvent } from '@angular/common/http';
import { MatButton } from '@angular/material';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { CustomValidators } from 'ng2-validation';
import { ngf, ngfModule } from 'angular-file';
// import { AccountAPI, JobOpeningAPI, SurveyApplyAPI } from '../../../serverCalls';
import { JobDetails, JobOpening, Survey, SurveyApply } from '../../../models';
// import { AuthService, SurveyService } from '../../../services';
@Component({
selector: 'ngx-apply-details',
templateUrl: './details.component.html',
styleUrls: ['./details.component.scss']
})
export class DetailsComponent implements OnInit {
public contactForm: FormGroup;
public resumePostUrl: 'http://localhost:8080/api/v1/resume';
public resume: FormData;
public httpEvent: HttpEvent<Event>;
private jobDetails: JobDetails;
private jobOpening: JobOpening;
constructor() {
this.contactForm = new FormGroup({
email: new FormControl('', [Validators.required, Validators.email]),
firstName: new FormControl('', [Validators.required]),
lastName: new FormControl('', [Validators.required]),
phoneNumber: new FormControl('', [Validators.required, CustomValidators.phone('en-CA')])
});
}
public ngOnInit(): void {
this.jobDetails = JobDetails.initializeFromLocalStorage();
this.jobOpening = this.jobDetails.jobOpenings[0];
}
public updateContactInformation(): void {
console.log('yaaaaaaaaay');
}
}
<mat-card>
<mat-card-header>
<mat-card-title>Upload New Resume & Cover Letter</mat-card-title>
</mat-card-header>
<mat-card-content>
<h3>Select files</h3>
<input ngf multiple type="file" accept="image/*" [(files)]="files" maxSize="1024" />
<button *ngIf="files" (click)="uploadFiles(files)">send files</button>
<ngfFormData [files]="files" [(FormData)]="resume" postName="file"></ngfFormData>
<ngfUploadStatus [(percent)]="uploadPercent" [httpEvent]="httpEvent"></ngfUploadStatus>
<div *ngIf="uploadPercent">
Upload Progress: {{ uploadPercent }}%
</div>
</mat-card-content>
</mat-card>