-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser keep crashing with @cloudinary/ng when try use it inside loop in Angular #222
Comments
Hi there, Thank you for your input. Regards, |
Hi @BechkoB, Here are my dependencies:
In addition, version 16 and up should be supported: https://github.com/cloudinary/frontend-frameworks/tree/master/packages/angular#version-support If you're still having an issue, can you please set a code sandbox and share the link with us? |
Hi @atdcloud here is the sandbox which crashes too: it works when you use the tag like that : <advanced-image [cldImg]="img"> , but when try to get the image through a method it crashes because sends a hundreds of requests to cloudinary |
Hello, @jroco-cloudinary Thanks, so what could be the best solution to use it inside *ngFor , for example I have an array of categories and icons for them, where I need the icons from cloudinary ? |
Hi @BechkoB, I modified your code and added elements that loop through an object. Please see here: https://2l2gln-4200.csb.app/ Basically, I declared an array of CloudinaryImage in the app.component.ts.
Then loop through it in the app.component.html.
Please let me know if this works for you. |
New issue for cloudinary/frontend-frameworks
Before proceeding, please update to the latest version and test if the issue persists
For which package is this issue?
@cloudinary/ng
Issue Type (Can be multiple)
[ ] Build - Can’t install or import the SDK
[ ] Performance - Performance issues
[ x] Behaviour - Functions aren’t working as expected
[ ] Documentation - Inconsistency between the docs and behaviour
[ ] Incorrect Types
[ ] Other (Specify)
Steps to reproduce
In my Angular App I get an Array with image details from Database with publicId field for example: images = [ { publicId : "something", cratedAt: "...", updatedAt: ".."}, etc.. ] .
And in my component I'm trying to loop over them and get the images from Cloudinary:
<advanced-image [cldImg]="getImg(image.publicId)">
The method looks like that:
getImg(publicId: string): CloudinaryImage {
console.log(publicId, 'publicId') const cld = new Cloudinary({
cloud: {
cloudName: environment.cloudinary.cloud_name,
},
})
return cld.image(publicId)
}
when I start the app, my browser crashes all the time. How can I fix this ? It was working before with angular 14 and the depreciated package @cloudinary/angular-5.x . I updated the project to Angular 16.
Browsers (if issue relates to UI, else ignore)
[ ] Chrome
[ ] Firefox
[ ] Safari
[ ] Other (Specify)
[x ] All
Versions and Libraries (fill in the version numbers)
@cloudinary/ng: "^2.0.0",
Node - v18.17.0
NPM - 9.4.0
The text was updated successfully, but these errors were encountered: