1.4.1 • Published 6 years ago

ngx-image-editor v1.4.1

Weekly downloads
50
License
MIT
Repository
github
Last release
6 years ago

Awesome editor for Angular 6 based on Angular Material

npm version Build Status

Live Demo on Slackblitz

Getting started

Step 1: Install Angular Material (+ Material Icons) and Angular Flex Layout
Step 2: Install cropperjs
    npm install --save cropperjs
Step 3: Add cropperjs file paths in your .angular.json
}
       "styles": [
         "node_modules/cropperjs/dist/cropper.css"
       ],
       "scripts": [
         "node_modules/cropperjs/dist/cropper.js"
       ]
}
Step 4: Install ngx-image-editor:
     npm install --save ngx-image-editor
Step 5: Import the NgxImageEditorModule within your app:
      import {NgxImageEditorModule} from "ngx-image-editor";

      @NgModule({
        imports: [
          NgxImageEditorModule
        ]
      })
Step 6: Use within your application:
   <ngx-image-editor [config]="yourConfig"></ngx-image-editor>

API

PropertyDescription
[config]An object containing editor configuration (see Configuration)
(file)The emitted file after editing.

Configuration

PropertyDescription
ImageNameName of the image.
ImageUrlURL of the image (if it coming from a CDN) .
FileFile object of the image (if it is being uploaded through the browser.
ImageTypeType of the image (default is image/jpeg).
AspectRatiosArray of aspect ratios. Available options: 0:0, 1:1 , 2:3 ,4:3, 16:9l . (default is 0:0)

Example

@Component({
  selector: 'app-root',
   styleUrls: ['./app.component.css']
  template: `
      <ngx-image-editor
        [config]="config"
        (close)="close($event)"
        (file)="getEditedFile($event)">
      </ngx-image-editor>

  `,

})
export class AppComponent {
  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() {
    // Fired when the editor is closed.
  }

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

Contributors

Hristo GeorgievTaulant Disha
Hristo GeorgievTaulant Disha
1.4.1

6 years ago

1.4.0

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.222

6 years ago

0.0.221

6 years ago

0.0.22

6 years ago

0.0.213

7 years ago

0.0.212

7 years ago

0.0.211

7 years ago

0.0.21

7 years ago

0.0.112

7 years ago

0.0.111

7 years ago

0.0.1

7 years ago