cloudinary / cloudinary_angular

Cloudinary Angular client library
MIT License
305 stars 228 forks source link

Can't set image placeholder in Angular v9 #269

Closed jneterer closed 4 years ago

jneterer commented 4 years ago

Describe the bug

When using <cl-placeholder></cl-placeholder> to set an image placeholder described here I am getting the following error:

ERROR TypeError: undefined is not a function at CloudinaryPlaceHolder.getPlaceholderImage (cloudinary-angular-5.x.js:277) at CloudinaryPlaceHolder.ngAfterContentChecked (cloudinary-angular-5.x.js:267)

This is my exact code. If I remove the <cl-placeholder></cl-placeholder> it loads the image as expected.

Issue Type

[ ] Build - Can’t install or import the SDK [ ] Babel - Babel errors or cross browser issues [ ] UI/Performance - Display or performance issues [X] Behaviour - Functions aren’t working as expected (Such as generate URL) [X] Documentation - Inconsistency between the docs and behaviour [ ] Incorrect Types [ ] Other (Specify)

Steps to reproduce

I have a single image in my account named angular-starters.png. Steps can be viewed in my repo and commit, I have provided those below.

Error screenshots

Screen Shot 2020-04-10 at 5 30 00 PM

Browsers (if issue relates to UI, else ignore)

[ ] Chrome [ ] Firefox [ ] Safari [ ] Other (Specify) [X] All

Versions and Libraries

"@cloudinary/angular-5.x": "^1.2.0-rc.0", "cloudinary-core": "^2.8.2", Angular - ~9.0.4 Node - 10.14.2 NPM - 6.14.4

Config Files

Package.json

{
  "name": "angular-starters",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.0.3",
    "@angular/cdk": "^9.1.0",
    "@angular/common": "~9.0.3",
    "@angular/compiler": "~9.0.3",
    "@angular/core": "~9.0.3",
    "@angular/forms": "~9.0.3",
    "@angular/material": "^9.0.3",
    "@angular/platform-browser": "~9.0.3",
    "@angular/platform-browser-dynamic": "~9.0.3",
    "@angular/router": "~9.0.3",
    "@cloudinary/angular-5.x": "^1.2.0-rc.0",
    "cloudinary-core": "^2.8.2",
    "mongodb-stitch-browser-sdk": "^4.8.0",
    "ng-inline-svg": "^10.0.0",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.4",
    "@angular/cli": "~9.0.4",
    "@angular/compiler-cli": "~9.0.3",
    "@angular/language-service": "~9.0.3",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~5.18.0",
    "typescript": "~3.7.5"
  }
}

Babelrc - NA

Repository

Repo: https://github.com/jneterer/angular-starters/tree/cloudinary-integration Commit: https://github.com/jneterer/angular-starters/commit/f1714e5cd144ae7e558acdb67e31370993102a79

Thanks for your help!!

patrick-tolosa commented 4 years ago

Thanks for the detailed report, We're investigating this issue and will report back shortly.

strausr commented 4 years ago

@jneterer Thank you for your report. This has been fixed in the latest release. Please let us know if you have any other issues.

jneterer commented 4 years ago

@patrick-tolosa @strausr The changes are working as expected, thank you for the quick response and fix!