Skip to content

Commit ec61dcd

Browse files
authored
update readme (#314)
1 parent 01a5dd5 commit ec61dcd

File tree

1 file changed

+57
-178
lines changed

1 file changed

+57
-178
lines changed

README.md

Lines changed: 57 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,45 @@
1-
Cloudinary
2-
==========
3-
The official [Cloudinary](https://cloudinary.com) SDK for Angular.
1+
Cloudinary Angular SDK
2+
=========================
3+
## About
4+
The Cloudinary Angular SDK allows you to quickly and easily integrate your application with Cloudinary.
5+
Effortlessly optimize, transform, and manage your cloud's assets.
46

5-
We maintain difference branches for different versions. Cloudinary's latest Angular SDK can be found [here](https://github.com/cloudinary/cloudinary_angular/tree/angular-5.x)
67

7-
[Cloudinary](https://cloudinary.com) is a cloud service that offers a solution to a web application's entire image management pipeline.
8+
#### Note
9+
This Readme provides basic installation and usage information.
10+
For the complete documentation, see the [Angular SDK Guide](https://cloudinary.com/documentation/angular_integration).
811

9-
Easily upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software. Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your website’s graphics requirements.
10-
Images are seamlessly delivered through a fast CDN, and much much more.
1112

12-
Cloudinary offers comprehensive APIs and administration capabilities and is easy to integrate with any web application, existing or new.
13+
## Table of Contents
14+
- [Key Features](#key-features)
15+
- [Version Support](#Version-Support)
16+
- [Installation](#installation)
17+
- [Usage](#usage)
18+
- [Setup](#Setup)
19+
- [Transform and Optimize Assets](#Transform-and-Optimize-Assets)
20+
- [Generate Image and HTML Tags](#Generate-Image-and-Video-HTML-Tags)
21+
1322

14-
Cloudinary provides URL and HTTP based APIs that can be easily integrated with any Web development framework.
23+
## Key Features
24+
- [Transform](https://cloudinary.com/documentation/angular1_video_manipulation#video_transformation_examples) and [optimize](https://cloudinary.com/documentation/angular1_image_manipulation#image_optimizations) assets.
25+
- Generate [image](https://cloudinary.com/documentation/angular1_image_manipulation#deliver_and_transform_images) and [video](https://cloudinary.com/documentation/angular1_video_manipulation#video_element) tags.
1526

16-
For Angular, Cloudinary provides an SDK for simplifying the integration even further.
17-
The SDK serves as a layer on top of one of [Cloudinary's Javascript library](https://github.com/cloudinary/cloudinary_js).
1827

28+
## Version Support
29+
| SDK Version | ng 2 | ng 4 | ng >=5.0.0 |
30+
|---------------|------|------|------------|
31+
| 5.x | X | X | V |
32+
| 4.x | X | V | X |
33+
| 2.x | V | X | X |
1934

20-
## Live examples ##################################################################
21-
Start experimenting right away with one of these live examples:
22-
23-
* [Codepen example](https://codepen.io/team/Cloudinary/project/editor/AxrvPZ/)
24-
* [Plunker example](https://plnkr.co/edit/Tvrwxt2AW8K5DEhuTKhB?p=preview)
25-
* [Glitch example](https://glitch.com/edit/#!/cloudinary-angular-sdk)
26-
27-
## Installation ######################################################################
28-
Install the SDK version that supports the Angular version you are using:
29-
30-
* For Angular 2, use `2.x`
31-
* For Angular 4, use `4.x`
32-
* For Angular versions greater than 5, use `5.x`
33-
34-
For example:
35-
35+
## Installation
3636
```shell
3737
npm install @cloudinary/angular-5.x cloudinary-core --save
3838
```
3939

40-
## Usage ######################################################################
41-
42-
The module provides three types of directives:
43-
44-
* A Cloudinary image component with child transformation directives for creating `<image>` tags and controlling its underlying chained transformations
45-
* A Cloudinary video component with child transformation directives for creating `<video>` tags with multiple video sources and settings and controlling its underlying chained transformations
46-
* Attribute directives for enhancing native HTML elements with Cloudinary image management capabilities
47-
48-
Further image manipulation options are listed in [this reference](https://cloudinary.com/documentation/image_transformations#reference).
49-
50-
Further video manipulation and delivery capabilities see listed in [this reference](https://cloudinary.com/documentation/video_manipulation_and_delivery).
51-
52-
Note that the attribute names in the docs are using snake_case, however this SDK supports both snake_case and kebab-case for attribute names,
53-
e.g. both `fetch_format: 'auto'` and `'fetch-format': 'auto'` are eventually translated to `f_auto`.
54-
55-
### Cloudinary module configuration and setup ##################################
56-
This SDK is based on the Cloudinary JS module, however the two are decoupled, i.e. this module's `Cloudinary` is a configurable service
57-
to which you provide your choice of our JS module.
58-
59-
Example Coudinary configuration in your application's module definition:
6040

41+
## Usage
42+
### Setup
6143
```javascript
6244
import { NgModule } from '@angular/core';
6345
// ...
@@ -73,151 +55,48 @@ import { Cloudinary } from 'cloudinary-core';
7355
export class AppModule { }
7456
```
7557

76-
See [samples folder](https://github.com/cloudinary/cloudinary_angular/tree/master/projects/angular-cld/samples) for a complete reference project.
77-
78-
### Creating new image tags with cl-image & cl-transformation ##################################
79-
80-
The [cl-image](https://github.com/cloudinary/cloudinary_angular/blob/master/projects/angular-cld/src/lib/cloudinary-image.component.ts) component generates an `<image>` tag with requested transformation, type, and format.
81-
The image tag can contain optional `<cl-transformation>` tags that will be used as chained transformations:
82-
58+
### Transform and Optimize Assets
59+
- [See full documentation](https://cloudinary.com/documentation/angular1_image_manipulation)
8360
```html
8461
<cl-image public-id="readme" class="thumbnail inline" angle="20" format="jpg">
8562
<cl-transformation height="150" width="150" crop="fill" effect="sepia" radius="20"></cl-transformation>
8663
<cl-transformation overlay="text:arial_60:readme" gravity="north" y="20"></cl-transformation>
8764
</cl-image>
8865
```
8966

90-
Will be compiled by Angular to:
91-
92-
```html
93-
<cl-image _ngcontent-ywn-2="" public-id="readme" class="thumbnail inline" format="jpg" angle="20" ng-reflect-public-id="readme">
94-
<img src="http://res.cloudinary.com/{your_cloud_name}/image/upload/c_fill,e_sepia,h_150,r_20,w_150/g_north,l_text:arial_60:readme,y_20/a_20/readme.jpg">
95-
</cl-image>
96-
```
97-
98-
### Creating new video tags with cl-video & cl-transformation ##################################
99-
100-
The [cl-video](src/cloudinary-video.component.ts) component generates a `<video>` tag with requested transformation, type, and format.
101-
102-
The generated `<video>` is created with configurable child `<source>` elements for all relevant formats supported by web browsers (`webm`, `mp4` and `ogv`), as well as a poster thumbnail image.
103-
104-
The video tag can contain optional `<cl-transformation>` tags that will be used as chained transformations:
105-
106-
```html
107-
<cl-video cloud-name="my_other_cloud" public-id="watchme" secure="true" class="my-videos">
108-
<cl-transformation overlay="text:arial_60:watchme" gravity="north" y="20"></cl-transformation>
109-
</cl-video>
110-
```
111-
112-
Will be compiled by Angular to:
113-
114-
```html
115-
<video class="my-videos" public-id="watchme" ng-reflect-public-id="watchme"
116-
poster="https://res.cloudinary.com/my_other_cloud/video/upload/g_north,l_text:arial_60:watchme,y_20/watchme.jpg">
117-
<source src="https://res.cloudinary.com/my_other_cloud/video/upload/g_north,l_text:arial_60:watchme,y_20/watchme.webm" type="video/webm">
118-
<source src="https://res.cloudinary.com/my_other_cloud/video/upload/g_north,l_text:arial_60:watchme,y_20/watchme.mp4" type="video/mp4">
119-
<source src="https://res.cloudinary.com/my_other_cloud/video/upload/g_north,l_text:arial_60:watchme,y_20/watchme.ogv" type="video/ogg">
120-
</video>
121-
```
122-
123-
#### Updating images and videos dynamically ######################################################
124-
You can update attributes dynamically for `<cl-image>` and `<cl-video>` elements to reload the underlying native elements with
125-
new transformations.
126-
127-
The following example from the sample projects demonstrates setting the opacity to 50% when hovering on top of an element:
128-
```html
129-
<cl-image
130-
public-id={{photo.public_id}}
131-
(mouseenter)="photo.isMouseOver = true"
132-
(mouseleave)="photo.isMouseOver = false"
133-
[attr.opacity]="photo.isMouseOver ? '50' : null"
134-
>
135-
```
136-
137-
### Attribute directives for enhancing HTML elements - clSrc, clHref, clSrcset ##################################
138-
139-
These directives transform the given URI to a cloudinary URL. For example:
140-
141-
```html
142-
<img clSrc="https://cloudinary.com/images/logo.png" type="fetch" fetch-format="auto" quality="auto">
143-
```
144-
145-
Will be compiled by Angular to:
146-
147-
```html
148-
<img clSrc="https://cloudinary.com/images/logo.png" fetch-format="auto" quality="auto" type="fetch" ng-reflect-clSrc="https://cloudinary.com/images/logo.png"
149-
src="http://res.cloudinary.com/{your_cloud_name}/image/fetch/f_auto,q_auto/https://cloudinary.com/images/logo.png">
150-
```
151-
152-
See additional usage examples [here](https://github.com/cloudinary/cloudinary_angular/blob/master/projects/angular-cld/src/lib/cloudinary-image.component.spec.ts) and in the sample projects.
153-
154-
## Samples ########################################################
155-
156-
You can find our sample projects, along with documentation in the [samples folder](https://github.com/cloudinary/cloudinary_angular/tree/master/projects/angular-cld/samples).
157-
158-
:information_source: In order to run the samples you need to create a new file called config.ts with your cloud credentials.
159-
Copy `config.ts.sample` in the sample of your choice and replace the placeholders with your credentials.
160-
161-
### What's in the box ########################################################
162-
Both sample applications demonstrate a basic photo gallery showcasing basic image transformations and upload of new images either by a file input dialog or by drag-and-drop.
163-
164-
The samples differ by their bundling solution and upload implementation:
165-
166-
* [Photo album sample app](https://github.com/cloudinary/cloudinary_angular/tree/master/projects/angular-cld/samples/photo_album)
167-
* Uses [ng2-file-upload](https://github.com/valor-software/ng2-file-upload) for uploading files using an opensource file uploader
168-
* Uses [Webpack](https://webpack.github.io) for bundling and serving the application
169-
* [Photo album sample app with jQuery](https://github.com/cloudinary/cloudinary_angular/tree/master/projects/angular-cld/samples/photo_album_with_jquery)
170-
* Uses [Cloudinary's jQuery plugin](https://cloudinary.com/blog/direct_upload_made_easy_from_browser_or_mobile_app_to_the_cloud#direct_uploading_from_the_browser_using_jquery) for uploading files using jQuery and blueimp.
171-
* Uses [SystemJS](https://github.com/systemjs/systemjs) for bundling the application and [lite-server](https://github.com/johnpapa/lite-server) for serving the application.
172-
* [Photo Album AOT compilation](samples/photo_album_aot)
173-
* Demonstrates usage of Cloudinary SDK in an [Angular AOT](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html) application
174-
* Uses [Rollup](http://rollupjs.org/) for bundling the application and [lite-server](https://github.com/johnpapa/lite-server) for serving the application.
175-
176-
Please consult with the respective README file of each sample for usage and additional information.
177-
178-
## Development ################################################################
179-
180-
:raised_hands: This module supports the following npm scripts:
181-
182-
* **lint** - Runs tslint on **/*.ts
183-
* **test** - Compiles TypeScript and runs unit tests on the generated JS files, re-running tests automatically on chages
184-
* **test-once** - Compiles TypeSCript and executes unit tests once, closing the browser once it's done
185-
* **pree2e** - Updates WebDriver binary
186-
* **start-sample** - Starts the photo album sample, without automatically opening the browser and navigating to the started app
187-
* **start-sample:jquery** - Same as *start-sample* for the jQuery sample
188-
* **install-sample-from-source** - Compiles TypeScript, packs this module and installs it into samples/photo_album
189-
* **install-sample-from-source:jquery** - Same as *install-sample-from-source* for the jQuery sample
190-
* **e2e** - Runs *install-sample-from-source*, starts the app and runs protractor tests on the started app
191-
* **e2e:jquery** - Same as *e2e* for the jQuery sample
192-
* **tsc** - Runs the tsc compiler
193-
* **tsc:w** - Runs the tsc compiler and watches for changes
194-
* **webdriver:update** - Updates WebDriver binary
195-
196-
## Additional resources ##########################################################
197-
198-
Additional resources are available at:
67+
### Generate Image and Video HTML Tags
68+
- Use <cl-image> to generate image tags
69+
- Use <cl-video> to generate video tags
19970

200-
* [Website](https://cloudinary.com)
201-
* [Interactive demo](https://demo.cloudinary.com/default)
202-
* [Documentation](https://cloudinary.com/documentation)
203-
* [Knowledge Base](https://support.cloudinary.com/hc/en-us)
204-
* [Documentation for Angular integration](https://cloudinary.com/documentation/angular_integration)
205-
* [Image upload documentation](https://cloudinary.com/documentation/upload_images)
206-
* [Image transformations documentation](https://cloudinary.com/documentation/image_transformations)
71+
### File upload
72+
This SDK does not provide file upload functionality, however there are [several methods of uploading from the client side](https://cloudinary.com/documentation/angular1_image_and_video_upload).
20773

208-
## Support #######################################################################
74+
## Contributions
75+
- Ensure tests run locally (```npm run test```)
76+
- Open a PR and ensure Travis tests pass
20977

210-
You can [open an issue through GitHub](https://github.com/cloudinary/cloudinary_angular/issues).
21178

212-
Contact us [https://cloudinary.com/contact](https://cloudinary.com/contact)
79+
## Get Help
80+
If you run into an issue or have a question, you can either:
81+
- Issues related to the SDK: [Open a Github issue](https://github.com/cloudinary/cloudinary_angular/issues)
82+
- Issues related to your account: [Open a support ticket](https://cloudinary.com/contact)
21383

214-
Stay tuned for updates, tips and tutorials: [Blog](https://cloudinary.com/blog), [Twitter](https://twitter.com/cloudinary), [Facebook](https://www.facebook.com/Cloudinary).
21584

216-
## Join the Community ##########################################################
85+
## About Cloudinary
86+
Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiences—irrespective of the viewing device.
21787

218-
Impact the product, hear updates, test drive new features and more! Join [here](https://www.facebook.com/groups/CloudinaryCommunity).
21988

89+
## Additional Resources
90+
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references): Comprehensive references, including syntax and examples for all SDKs.
91+
- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers
92+
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on YouTube.
93+
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and on-site courses.
94+
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop for all code explorers, Postman collections, and feature demos found in the docs.
95+
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should develop next.
96+
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to other Cloudinary developers.
97+
- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.
98+
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.
22099

221-
## License #######################################################################
222100

223-
Released under the MIT license.
101+
## Licence
102+
Released under the MIT license.

0 commit comments

Comments
 (0)