You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

angular2-resizing-cropping-image

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-resizing-cropping-image

Resizing and cropping images with Angular 4

1.0.0-final.4
Version published
Weekly downloads
33
-42.11%
Maintainers
1
Weekly downloads
 
Created

Resizing & cropping images with Angular 2

demo

Install

# install the repo with npm
npm install angular2-resizing-cropping-image

Example

# import
import { LyResizingCroppingImagesModule } from 'angular2-resizing-cropping-image';
@NgModule({
    imports : [LyResizingCroppingImagesModule, ...],
})
import { Component } from '@angular/core';

@Component({
  selector: 'image-upload',
  styles: [`
    :host{
      display: block
    }
    `],
  template: `
  <input (change)="_img.imgChange($event)" type="file">

  <button (click)="_img.zoom('+')">+</button>
  <button (click)="_img.zoom('-')">-</button>
  <button (click)="_img.center()">center</button>

  <ly-cropping-img #_img format="png"></ly-cropping-img>
  <div>Format input: {{_img._img.type}}</div>
  <br />
  <div>Format output: {{_img.format}}</div>
  <br />
  <div>Result: </div>
  <br />
  <img [src]="_img.imgCrop">
  <br />
  <input [(ngModel)]="_img.sizeW" placeholder="_img size W">
  <input [(ngModel)]="_img.sizeH" placeholder="_img size H">
  <input [(ngModel)]="_img.img" placeholder="Img">
  `
})
export class imgUpload {}

FAQs

Package last updated on 16 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts