npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cloudinary-angular

v1.0.1

Published

Cloudinary Angular module

Downloads

103

Readme

cloudinary-angular

A port of the offical Cloudinary library for angular (Cloudinary_angular) without the dependency on jquery (see Issue 18), plus two new directives: cl-background-image and cl-video (and cl-video-transformation).

Installation

$ npm install --save cloudinary-angular

Include the script in your index file

<script src="node_modules/cloudinary-angular/dist/cloudinary-angular.min.js"></script>

Configure it

angular.module('myApp', ['cloudinary']);

/* @ngInject */
function configure(CloudinaryProvider) {    
    CloudinaryProvider.configure({
        cloud_name: 'your cloud name',
        api_key: 'your api key'
    });
}

angular
    .module('myApp')
    .config(configure);

And now you can use it

<cl-image public-id="sample" format="jpg">
	<cl-transformation height="80" width="80" crop="thumb" gravity="face" radius="max" border="2px_solid_rgb:00390b60" />
</cl-image>

You can also inject a service and use that to get the correct urls

/* @ngInject */
function Somecontroller(Cloudinary) {
    var publicUrl = Cloudinary.url('sample', { format: 'jpg', height: '512', width: '1024', crop: 'limit' });
}

Documentation

(Have a look at the sample directory to see it in action)

cl-href, cl-src, cl-srcset

<!-- cl-href -->
<a cl-href="sample" format="jpg" target="_blank">Sample</a>
<!-- cl-src -->
<img cl-src="sample" height="80" width="80" format="jpg">
<!-- cl-src and cl-srcset -->
<img cl-src="sample" cl-srcset="sample 1x, sample 2x" height="80" width="80" format="jpg">

cl-image

Set the following attributes on the directive:

  • public-id
  • format

And then add transformations on the cl-transformation directive

<cl-image public-id="sample" format="jpg">
	<cl-transformation height="80" width="80" crop="thumb" gravity="face" radius="max" border="2px_solid_rgb:00390b60" />
</cl-image>

It also supports the facebook, twitter and gravatar options, example:

<cl-image public-id="billclinton.jpg" type="facebook"></cl-image>

cl-video

This directives creates a html5 video tag either with a poster specificed by your on from the public_id

<cl-video public-id="SampleVideo" preload="none" controls>
	Your browser does not support the <code>video</code> element.
	<cl-video-transformation height="300" width="300" crop="pad" background="blue" />
</cl-video>
<!-- or -->
<cl-video public-id="SampleVideo" poster="http://res.cloudinary.com/dklsomzcw/image/upload/h_300,w_300/sample.jpg" preload="none" controls>
	Your browser does not support the <code>video</code> element.
	<cl-video-transformation height="300" width="300" crop="pad" background="blue" />
</cl-video>

cl-background-image

This directive makes a fullsize cover background image given a public-id.

<div class="image" cl-background-image="sample" format="jpg" crop="fill" gravity="center" quality="50"></div>

This translates to:

<div class="image" cl-background-image="sample" format="jpg" crop="fill" gravity="center" quality="50" style="background-image: url(http://res.cloudinary.com/<cloud_name>/image/upload/c_fill,g_center,q_50/sample.jpg); background-color: transparent; background-position: 50% 50%; background-repeat: no-repeat; background-size: cover"></div>

Develop

Install nodejs and the following packages globally:

  • gulp
  • tsd

then run:

  • npm install
  • tsd reinstall --save --overwrite

To build run gulp

License

MIT