
Product
Introducing Repository Labels and Security Policies
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
cloudinary-angular
Advanced tools
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).
$ 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' });
}
(Have a look at the sample directory to see it in action)
<!-- 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">
Set the following attributes on the directive:
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>
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>
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>
Install nodejs and the following packages globally:
then run:
To build run gulp
MIT
FAQs
Cloudinary Angular module
The npm package cloudinary-angular receives a total of 17 weekly downloads. As such, cloudinary-angular popularity was classified as not popular.
We found that cloudinary-angular demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Research
Security News
Socket researchers uncovered malicious npm and PyPI packages that steal crypto wallet credentials using Google Analytics and Telegram for exfiltration.
Product
Socket now supports .NET, bringing supply chain security and SBOM accuracy to NuGet and MSBuild-powered C# projects.