hggeorgiev / ngx-image-editor

Awesome image editor for Angular 6
MIT License
72 stars 36 forks source link

Can't bind to 'config' since it isn't a known property of 'ngx-image-editor'. #24

Open saurabhjaju2418 opened 5 years ago

saurabhjaju2418 commented 5 years ago

Angular7

Can't bind to 'config' since it isn't a known property of 'ngx-image-editor'.

  1. If 'ngx-image-editor' is an Angular component and it has 'config' input, then verify that it is part of this module.
  2. If 'ngx-image-editor' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

component.html

<ngx-image-editor [ERROR ->][config]="config" (close)="close($event)" (file)="getEditedFile($event)">>"):

component.ts file public config = { ImageName: 'Some image', AspectRatios: ["4:3", "16:9"], ImageUrl: 'https://static.pexels.com/photos/248797/pexels-photo-248797.jpeg', ImageType: 'image/jpeg' }

public close(event: any) {
    // Fired when the editor is closed.
    console.log(event);

}

public getEditedFile(file: File) {
    // Fired when the file has been processed.
    console.log(file);
}

app.module.ts import { NgxImageEditorModule } from "ngx-image-editor";

@NgModule({ declarations: [ ], imports: [ NgxImageEditorModule, ], providers: [

], bootstrap: [AppComponent] }) export class AppModule { }

package.json "ngx-image-editor": "1.4.1", "cropperjs": "^1.3.5", "@angular/flex-layout": "^5.0.0-beta.14", "@types/cropperjs": "1.1.3", "@angular/cdk": "^7.3.7", "@angular/common": "^7.2.15", "@angular/compiler": "^7.2.15", "@angular/compiler-cli": "^7.2.15", "@angular/core": "^7.2.15", "@angular/material": "^7.3.7",