Coder Social home page Coder Social logo

imagekit-developer / imagekit-angular Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 19.0 3.8 MB

Angular SDK for ImageKit.io client side file upload and URL generation

Home Page: https://imagekit.io

JavaScript 12.68% TypeScript 82.47% HTML 4.08% CSS 0.09% Shell 0.69%
hacktoberfest image-manipulation image-optimization

imagekit-angular's People

Contributors

abhinavr4 avatar ankur-dwivedi avatar anubhavjain786 avatar dependabot[bot] avatar imagekitio avatar lgtm-migrator avatar manu4543 avatar mrdhat avatar ngyongzhen avatar subhkarm avatar violetviolinist avatar vivekvdwivedi avatar vvdwivedi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

imagekit-angular's Issues

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 }])
    }
}

Angular Version 9 Support

Hello,

I am interested in moving from Cloudinary to Imagekit, however Imagekit does not have support for Angular version 9. I tried using it in my Angular 9 application, but I am running into various issues. One of which is the following:

ERROR in ./node_modules/imagekitio-angular/ivy_ngcc/imagekitio-angular.js
Module not found: Error: Can't resolve '../../package.json' in '/angular-starters/node_modules/imagekitio-angular/ivy_ngcc'

Do you know if there are plans to upgrade the library to support Angular 9? If so, when could I expect that to be complete?

Thanks,

Jacob Neterer

Getting error while integrating with angular 8 lazy load modules.

Hi,
I'm trying to integrate image-kit with my angular 8 app.

I followed the documentation for setting up the things.

It is working well if I use <ik-image src="my-img-url" alt="This is an alt"></ik-image> in app.component.html but I'm getting the following error if I use it in my lazy loading module components.
image

To deal with this error, I moved the below code /import to my shared module.

ImagekitioAngularModule.forRoot({
publicKey: environment.publicKey,
urlEndpoint: environment.urlEndpoint,
authenticationEndpoint: environment.authenticationEndpoint + 'image_kit/auth'
}),

But Im getting the below error.

image

So can you please tell me what I am doing wrong/ missing here.

Thank you.

Compilation fails due to missing generic type

The compilation error is related to a deprecated API: ModuleWithProviders type without a generic.

Angular error:

Error: node_modules/imagekitio-angular/imagekitio-angular/imagekitio-angular.module.d.ts:4:52 - 
error NG6005: ImagekitioAngularModule.forRoot returns a ModuleWithProviders type without a generic type argument.
Please add a generic type argument to the ModuleWithProviders type.
If this occurrence is in library code you don't control, please contact the library authors.

4     static forRoot(config: ImageKitConfiguration): ModuleWithProviders;

TypeScript error:

Error: node_modules/imagekitio-angular/imagekitio-angular/imagekitio-angular.module.d.ts:4:52 - 
error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

4     static forRoot(config: ImageKitConfiguration): ModuleWithProviders;

Missing test cases

  • Upload test cases missing. It should spy function to make sure all parameters are being sent to the Javascript SDK function.
  • URL generation test cases do not handle case of leading and trailing slashes in urlEndpoint or path parameter. The SDK should handle the presence and absence of trailing slash in urlEndpoint parameter. Also, the SDK should handle the presence and absence of leading slash in path parameters. The SDK should not add double slash e.g. {urlEndpoint}//{path}
  • Adding transformation in query parameter missing

Angular 16 - ModuleWithProviders indentical type error

I updated to the most recent version of ImageKit (2.0.2) to get this library working with Angular 16. When building the app with "ng serve" I get following error:

Any idea how to make it work?

Node version : 18.10
Angular: 16.2.0
npm: 9.8.1

Error: node_modules/@angular/core/index.d.ts:5795:26 - error TS2428: All declarations of 'ModuleWithProviders' must have identical type parameters.

5795 export declare interface ModuleWithProviders<T> {
                              ~~~~~~~~~~~~~~~~~~~


Error: node_modules/imagekitio-angular/imagekitio-angular/imagekitio-angular.module.d.ts:4:15 - error TS2428: All declarations of 'ModuleWithProviders' must have identical type parameters.

4     interface ModuleWithProviders {
                ~~~~~~~~~~~~~~~~~~~


Error: node_modules/imagekitio-angular/imagekitio-angular/imagekitio-angular.module.d.ts:5:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'ngModule' must be of type 'Type<T>', but here has type 'Type<any>'.

5         ngModule: Type<any>;
          ~~~~~~~~

  node_modules/@angular/core/index.d.ts:5796:5
    5796     ngModule: Type<T>;
             ~~~~~~~~
    'ngModule' was also declared here.


Error: node_modules/imagekitio-angular/imagekitio-angular/imagekitio-angular.module.d.ts:6:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'providers' must be of type '(Provider | EnvironmentProviders)[]', but here has type 'Provider[]'.

6         providers?: (Provider)[] | undefined;
          ~~~~~~~~~

  node_modules/@angular/core/index.d.ts:5797:5
    5797     providers?: Array<Provider | EnvironmentProviders>;
             ~~~~~~~~~
    'providers' was also declared here.


Error: node_modules/imagekitio-angular/imagekitio-angular/imagekitio-angular.module.d.ts:10:52 - error NG6005: ImagekitioAngularModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.

10     static forRoot(config: ImageKitConfiguration): ModuleWithProviders;

Typo in README

The README seems to have a typo in the introductory sentence.

ImageKit Angular SDK allows you to resize, optimize, deliver, and upload images and videos in your react application.

I believe the correct sentence should be

ImageKit Angular SDK allows you to resize, optimize, deliver, and upload images and videos in your Angular application.

End to end test case

Add end-to-end test cases using cypress to assert the correct behavior of all functionality. The same has been done in React SDK

Support for Angular 16

Currently with Angular 16 and "imagekitio-angular": "^2.0.0", following error is produced when. buidling the app.

static forRoot(config: ImageKitConfiguration): ModuleWithProviders;

Is there any way to use this library with Angular 16 or is there an update needed from you?

LQIP with folder in S3

Hi,

I'm trying to add LQIP function, unfortunately without success.
My pictures are stored in AWS S3 in different folders :

  • projects/XX.jpg
  • covers/XX.jpg

My component.html :

<ik-image [path]="path" [lqip]="lqip"></ik-image>

My component.ts :

lqip = { active: true, quality: 5 };

In the network tab I catch this url :
https://ik.imagekit.io/token/tr:q-5/projects
Why the end of the path is missing ?

Without lqip I can see my image :
https://ik.imagekit.io/token/projects/13/XX.jpg?ik-sdk-version=angular-1.0.2

Other question : There is a way to add blur on lqip ?

Using the sdk on @angular/core 17.0.2 gives a type error

Reported Issue:

Using the SDK on @angular/core 17.0.2 throws the error "ImagekitioAngularModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type to the ModuleWithProviders type. If this occurence is in library code you don't control, please contact the library authors."

image
image

Issue:

Angular has deprecated "ModuleWithProviders type without a generic"

Please refer to following links for reference associated with this deprecation

Solution:

Add ImagekitioAngularModule type argument to ModuleWithProviders in file imagekitio-angular.module.ts

The code should look like

static forRoot(config: ImageKitConfiguration): ModuleWithProviders<ImagekitioAngularModule> {

Will this work with Angular 15.

In the preliminary phases of looking at image kit as solution for product Iโ€™m working on. Curious if this will work with the latest version of angular.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.