0

I am using Cloudinart on Angular and I want to generate a Cloudinary url.

<cl-image public-id="public_id">
                                <cl-transformation height="270" width="480" crop="fill"/>
                            </cl-image>

The image tag is generated with the above code. Is it possible to generate only a URL so that I can use it as a background image of the div?

Roee Ben-Ari
  • 600
  • 3
  • 12
Sameer Sheikh
  • 499
  • 1
  • 6
  • 16
  • Angular Cloudinary plugin provides another one directive [cl-href](https://github.com/cloudinary/cloudinary_angular#manipulation-url-generation-directives---cl-src-cl-href-cl-srcset). Perhaps that is what you are looking for – valverde93 Feb 10 '16 at 09:27

1 Answers1

1

You can use:

var url = cloudinary.url("public_id", {height: 270, width: 480, crop: "fill"});
Itay Taragano
  • 1,901
  • 1
  • 11
  • 12
  • i am using angular only. – Sameer Sheikh Feb 11 '16 at 06:09
  • I'm not sure what you mean. The mentioned code snippet is a pure javascript code. This uses Cloudinary's core javascript library which is automatically included when using Cloudinary's Angular library. See: https://github.com/cloudinary/cloudinary_angular/blob/master/js/angular.cloudinary.js#L164-L164 – Itay Taragano Feb 11 '16 at 13:30