cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

This project isn't working with Angular 2 final release #73

Closed ghost closed 7 years ago

ghost commented 8 years ago

Hello guys,

This plugin is'nt working properly with Angular 2 final release. My app is crashing when i just try to import.

Maybe the github's version is working and NPM not. Can you release a new subversion to NPM?

I'm using this project into my App by 5 months and was working nicely! But we had to upgrade the Angular.

Thanks @cstefanache , @KingsDevelopment and all developers envolved!

damienadermann commented 8 years ago

@mayconjcm I am using it on 2.0.0. What error are you getting?

lapachuka commented 8 years ago

+1 doesn't work. error: "Can't bind to 'image' since it isn't a known property of 'img-cropper'.

  1. If 'img-cropper' is an Angular component and it has 'image' input, then verify that it is part of this module. .... "

systemjs.config.js: .map: { 'ng2-img-cropper': 'npm:ng2-img-cropper' } .packages: { 'ng2-img-cropper': {main: 'index.js', defaultExtension: 'js'}, }

app.component.ts: " import {Component} from '@angular/core'; import {ImageCropperComponent} from 'ng2-img-cropper';

@Component({ selector: 'my-app', styleUrls: ['app/app.component.css'],

template: `
    <div class="container">
      <router-outlet></router-outlet>
      <div class="pull-left">
        <h3>Sample cropper 1</h3>
        <img-cropper [image]="data1" [settings]="cropperSettings1" (onCrop)="cropped($event)"></img-cropper>
        <br>
        <span class="result" *ngIf="data1.image" >
            <img [src]="data1.image">
        </span>
    </div>
    </div>
 `,
directives: [ImageCropperComponent]

})

export class AppComponent { title = 'My members'; } "

cstefanache commented 8 years ago

checkout this plnkr: https://embed.plnkr.co/VFwGvAO6MhV06IDTLk5W/

besseddrest commented 8 years ago

I am getting the following template parsing errors, similar to @lapachuka above:

Can't bind to 'image' since it isn't a known property of 'img-cropper'.
Can't bind to 'settings' since it isn't a known property of 'img-cropper'.
'img-cropper' is not a known element:

I am using 2.1.0

cstefanache commented 8 years ago

are you doing anything different than the plnkr? (image is populated on the data object) - is the module loaded?

lapachuka commented 8 years ago

I have fixed. What i changed: 1) Update image cropper to release 0.7.1 2) in module add Declaration like in plnkr

declarations: [ MemberComponent ] then it start working. Make sure that image cropper has right release with angular 2.0.1. Plnkr works with 0.7.1

cstefanache commented 8 years ago

@besseddrest @mayconjcm can you please that it works for you so we can close the issue? Please see @lapachuka's comment

ghost commented 8 years ago

I will test today!

besseddrest commented 8 years ago

Out of town but will be able to test Monday or Tuesday, thanks!

Tiliavir commented 7 years ago

I assume this can be closed, it is working with angular 2.2.3 and ng2-img-cropper 0.7.5.

cstefanache commented 7 years ago

Thanks @Tiliavir - closing