when I\'m trying to install \"npm install ng2-file-upload --save\" in my angular 4 application it throws
UNMET PEER DEPENDENCY @4.1.0
UNMET PEER DEPENDENCY
For common solution is to create new module like shared module
. You just need create shared module like
this and import shared module in app.module
file
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { FileSelectDirective, FileDropDirective } from 'ng2-file-upload';
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
@NgModule({
imports: [ FileUploadModule],
declarations: [ ],
exports :[ FileSelectDirective, FileDropDirective, FormsModule,
FileUploadModule],
})
export class SharedModule { }
just import share.module in your app.module like this.
import { NgModule } from '@angular/core';
import { SharedModule} from '../shared/shared.module';
@NgModule({
imports: [SharedModule],
declarations: [],
exports :[],
})
export class AppModule { }
take a look on lazy loading in angular 4