diff --git a/README.md b/README.md index 380fc7d..4054de4 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ Please consult with the respective README file of each sample for usage and addi * **test** - Compiles TypeScript and runs unit tests on the generated JS files, re-running tests automatically on chages * **test-once** - Compiles TypeSCript and executes unit tests once, closing the browser once it's done * **pree2e** - Updates WebDriver binary -* **start-sample** - Starts the photo album sample, without automatically opening the browser and navingating to the started app +* **start-sample** - Starts the photo album sample, without automatically opening the browser and navigating to the started app * **start-sample:jquery** - Same as *start-sample* for the jQuery sample * **install-sample-from-source** - Compiles TypeScript, packs this module and installs it into samples/photo_album * **install-sample-from-source:jquery** - Same as *install-sample-from-source* for the jQuery sample diff --git a/projects/angular-cld/src/lib/cloudinary.service.spec.ts b/projects/angular-cld/src/lib/cloudinary.service.spec.ts index 67414b6..86d98a1 100644 --- a/projects/angular-cld/src/lib/cloudinary.service.spec.ts +++ b/projects/angular-cld/src/lib/cloudinary.service.spec.ts @@ -22,6 +22,17 @@ describe('Cloudinary service', () => { expect(service instanceof Cloudinary).toBe(true); }); + it('updates the configuration', () => { + + const newConfig: CloudinaryConfiguration = { + cloud_name: 'new-service-test' + }; + + service.updateConfig(newConfig) + + expect(service.config().cloud_name).toEqual(newConfig.cloud_name); + }); + it('creates responsive urls by interacting with cloudinary core', () => { const imgElement = {} as HTMLImageElement; const options = { diff --git a/projects/angular-cld/src/lib/cloudinary.service.ts b/projects/angular-cld/src/lib/cloudinary.service.ts index c228233..46e9573 100644 --- a/projects/angular-cld/src/lib/cloudinary.service.ts +++ b/projects/angular-cld/src/lib/cloudinary.service.ts @@ -85,6 +85,10 @@ export class Cloudinary { return this._cloudinaryInstance.config(); } + updateConfig(configuration: CloudinaryConfiguration) { + this._cloudinaryInstance.config(configuration); + } + url(...parameters): string { return this._cloudinaryInstance.url(...parameters); }