brtnshrdr / angular2-image-zoom

An Angular2 Image Zoom Directive
MIT License
22 stars 16 forks source link

Can't bind to 'imageZoom' since it isn't a known property of 'img' #6

Closed MickL closed 7 years ago

MickL commented 7 years ago

Added "ImageZoomModule" to imports as described in readme. Error:

Can't bind to 'imageZoom' since it isn't a known property of 'img'

Using latest Angular-CLI (beta 31) with Angular 2.4.x

MickL commented 7 years ago

Probably npm version is not correct. I don't see any decorators like @Directive or @Component.

Addition: Not sure why but npm install https://github.com/brtnshrdr/angular2-image-zoom.git is not adding any ts files (index.ts and src/*.ts).

Adding it manually worked:

import {ImageZoomModule} from "../temp/angular2-image-zoom/index";

@NgModule({
  imports: [ImageZoomModule]
});
brtnshrdr commented 7 years ago

Don't install it from github. Just install from NPM

'npm install angular2-image-zoom' Then import 'import {ImageZoomModule} from 'angular2-image-zoom'

GitHub doesn't have the correct files

MickL commented 7 years ago

The first comment was about npm install angular2-image-zoom. Second comment was just an addition. Please reopen: npm files don't have any decorators.

brtnshrdr commented 7 years ago

Decorators won't exist in the compiled files. I'm using this project with angular 2.4.7 just fine.

MickL commented 7 years ago

Still didn't work for me. I ended up using a plain JS-libary instead und let it run out of Angular zone because this projects triggers change detection too often. Using the directive on base64 image leads to massive lags.