imagekit-angular
imagekit-angular copied to clipboard
Add service to generate url in component.ts
Hello, thanks for a nice lib.
I think it might be useful to have some service which can be used in angular component in order to get proper URL.
Possible usage example
Import { ImagekitService } from 'imagekitio-angular';
@Component({
selector: 'app-image-component',
template: `<img [src]=image />`
})
export class ImageComponent {
image: string;
constructor(private imagekitService: ImagekitService) {
this.image = this.imagekitService.getUrl('path/to/image.png', [{ width: 300, height: 400 }])
}
}
@tshenin Thanks for the feedback. We could export the imagekit-javascript library because we use it anyway. We are planning to make updates to this SDK in September.
For now, you can directly use the imagekit-javascript SDK to generate the URL. It will add around 2.5KB of extra code to your final bundle (gzipped).
Fixed in version 2.0.0.