You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please make sure this local email is also added to your
31
-
[GitHub email list](https://github.com/settings/emails) so that your commits
32
-
will be properly associated with your account and you will be promoted to
33
-
Contributor once your first commit is landed.
34
-
35
-
## Building the project
36
-
37
-
The project consists of following major parts
38
-
39
-
- sdk (contains the SDK code)
40
-
- samples (sample usage and usage example with other angular versions)
41
-
42
-
### SDK development
1
+
## SDK development
43
2
44
3
SDK is build in angular 4 for forward compatibilty and `ng-packagr` is used to create final package. Make sure `@angular/cli` is at `v1.4.*` before building the package.
45
4
46
-
###Building package
5
+
## Building package
47
6
48
-
Use
7
+
Execute following command from the `sdk` folder to build the library. This creates a package in `dist/imagekitio-angular` folder.
49
8
```sh
9
+
# run `npm install` for first time
50
10
npm run build
51
11
```
52
-
from the `sdk` folder to build the library. This creates a package in `dist/imagekitio-angular` folder.
53
12
54
-
###Running Tests
13
+
## Running test cases
55
14
56
15
The designated directory for tests is `sdk/src/sdk-tests` folder. All tests will be executed once on the Chrome Headless browser.
57
16
58
-
Use
17
+
Execute following command from the `sdk` folder to start testing.
59
18
```sh
60
19
npm run test
61
20
```
62
-
from the `sdk` folder to start testing.
63
21
64
-
###Running Sample Apps
22
+
## Running sample angular app
65
23
66
-
Every sample app requires a different version of Angular CLI. Please refer to individual sample app `Readme.md` for details.
67
-
Before sample apps can be used, `imagekitio-angular` library needs to be packed and installed using file system within the sample apps. Use the following steps to run any sample app.
24
+
Every sample app requires a different version of Angular CLI. Please refer to the individual sample app `Readme.md` for details.
25
+
Before sample apps can be used, `imagekitio-angular` library needs to be packed and installed using the file system within the sample apps. Use the following steps to run any sample app.
68
26
69
27
1. In the `sdk` folder, install dependencies with `npm install`
70
28
2. Build library with `npm run build`
71
29
3. In the `sdk/dist/imagekitio-angular` folder, use `npm pack` to create a tarball with version mentioned in the current package.json for sdk.
72
30
4. Go to `samples/imagekitio-angular<x>-sample` folder and use `npm install` to install dependencies.
73
-
5. Use `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-x.x.x.tgz` where x.x.x needs to be replaced with current version. For example, sdk version is `0.0.1`, then above command becomes `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-0.0.1.tgz`
31
+
5. Use `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-x.x.x.tgz` where x.x.x needs to be replaced with the current version. For example, SDK version is `0.0.1`, then above command becomes `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-0.0.1.tgz`
74
32
6. Configure sample app with required keys. Use each app's `Readme.md` for exact details.
75
-
7. Use npm start from the `samples/imagekitio-angular<x>-sample` folder to run app for particular angular version.
33
+
7. Use npm start from the `samples/imagekitio-angular<x>-sample` folder to run the app for a particular angular version.
76
34
77
-
###Running Sample Server
35
+
## Running sample backend server
78
36
79
37
Sample server for upload implementation is available at `samples/sample-server`. To run the server, follow these steps
80
38
81
39
1. Create a `.env` file based on `sample.env` and enter your private key.
82
40
2. Use `npm install` to install dependencies.
83
-
3. Use `npm run server` to start the server.
41
+
3. Use `npm run server` to start the server. It will expose the [authentication endpoint](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) on `http://localhost:3000/auth`
Angular SDK for [ImageKit.io](https://imagekit.io) which implements client-side upload and URL generation for use inside an angular application.
8
+
Angular SDK for [ImageKit.io](https://imagekit.io), which implements client-side upload and URL generation for use inside an angular application.
9
9
10
-
ImageKit is a complete image optimization and transformation solution that comes with an [image CDN](https://imagekit.io/features/imagekit-infrastructure) and media storage. It can be integrated with your existing infrastructure - storages like AWS S3, web servers, your CDN and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
10
+
ImageKit is a complete image optimization and transformation solution that comes with an [image CDN](https://imagekit.io/features/imagekit-infrastructure) and media storage. It can be integrated with your existing infrastructure - storages like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
11
11
12
12
## Installation
13
13
@@ -52,7 +52,7 @@ In order to use the SDK, you need to provide it with a few configuration paramet
52
52
`authenticationEndpoint` is essential if you want to use the SDK for client-side uploads.
53
53
`transformationPosition` is optional. The default value for the parameter is `path`. Acceptable values are `path` & `query`
54
54
55
-
_Note: Do not include your Private Key in any clientside code, including this SDK or its initialization. If you pass the `privateKey` parameter while initializing this SDK, it throws an error_
55
+
_Note: Do not include your Private Key in any client-side code, including this SDK or its initialization. If you pass the `privateKey` parameter while initializing this SDK, it throws an error_
56
56
57
57
### ik-image
58
58
@@ -143,7 +143,7 @@ const transformations = [{
143
143
The above image will apply transformation of width = 90 and height = 180 on the image. Since some transformatinos are destructive you might want to control the order in which the transforms are applied.
144
144
145
145
##### Chained Transforms
146
-
Chained transforms make it easy to specify the order the transform are applied. example:
146
+
Chained transformations provide a simple way to control the sequence in which transformations are applied.
147
147
148
148
```js
149
149
consttransformations= [
@@ -156,7 +156,7 @@ const transformations = [
156
156
}
157
157
];
158
158
```
159
-
In the above case, rotation will be performed first and resizing according to width and aspect ratio will be performed afterwards.
159
+
In the above case, the rotation will be performed first, and resizing according to width and aspect ratio will be performed afterward.
160
160
161
161
#### Low Quality Image Placeholders (LQIP) for images
162
162
The SDK supports automatic support for LQIP for your images, if you set lqip to true in the image component. example:
@@ -168,21 +168,42 @@ The SDK supports automatic support for LQIP for your images, if you set lqip to
168
168
`quality` decided the quaility of placeholder image. It can be any numeric value, a low number means low quality, and high number means high quality.
169
169
170
170
##### How does the lqip work?
171
-
The component tries to keep the it simple, it loads a lower quality image using the quality parameter to load a lower quality image, which is then replaced with the actual quality image later.
171
+
The component tries to keep it simple. It loads a lower quality image using the quality parameter to load a lower quality image, which is then replaced with the actual quality image later.
172
172
173
173
## File Upload
174
174
#### ik-upload
175
175
The SDK provides a simple Component to upload files to the ImageKit Media Library. It has an attribute called `fileName` which is used by SDK for `fileName` parameter required to upload. The `file` parameter is provided as an input from the user.
176
176
177
-
Also make sure that you have specified `authenticationEndpoint` during SDK initialization. The SDK makes an HTTP GET request to this endpoint and expects a JSON response with three fields i.e. `signature`, `token` and `expire`.
177
+
Also, make sure that you have specified `authenticationEndpoint` during SDK initialization. The SDK makes an HTTP GET request to this endpoint and expects a JSON response with three fields, i.e. `signature`, `token`, and `expire`.
178
178
179
179
[Learn how to implement authenticationEndpoint](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) on your server.
180
180
181
181
An example of this server is provided in the sample-server folder of the SDK.
182
182
183
183
Sample Usage
184
184
```js
185
+
// Simple upload
185
186
<ik-upload fileName="my-upload"/></ik-upload>
187
+
188
+
// Using callbacks and other parameters of upload API
`ik-upload` component accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#request-structure-multipart-form-data) as attributes e.g. `tags`, `useUniqueFileName`, `folder`, `isPrivateFile`, `customCoordinates` etc.
194
+
195
+
## Sample application
196
+
The `samples` folder contains a fully working sample angular application for angular versions 4, 5, 6, 7, and 8. Every application has a README.md file with full instructions on how to run it locally.
197
+
198
+
## Support
199
+
200
+
For any feedback or to report any issues or general implementation support, please reach out to [[email protected]](mailto:[email protected])
Copy file name to clipboardExpand all lines: samples/imagekitio-angular4-sample/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
10
10
@angular/cli: 1.4.10
11
11
```
12
12
13
-
## Runnning the application
13
+
## Running the application
14
14
15
15
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
Copy file name to clipboardExpand all lines: samples/imagekitio-angular5-sample/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Imagekit Angular 5 Sample
2
2
3
-
This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please note that you need to have `@angular/cli v1.6.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
3
+
This project shows the usage of ImageKit Angular SDK in an Angular 5 app. Please note that you need to have `@angular/cli v1.6.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
4
4
5
5
6
6
```sh
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
10
10
@angular/cli: 1.6.6
11
11
```
12
12
13
-
## Runnning the application
13
+
## Running the application
14
14
15
15
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
Copy file name to clipboardExpand all lines: samples/imagekitio-angular6-sample/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Imagekit Angular 6 Sample
2
2
3
-
This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please note that you need to have `@angular/cli v6.1.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
3
+
This project shows the usage of ImageKit Angular SDK in an Angular 6 app. Please note that you need to have `@angular/cli v6.1.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
4
4
5
5
6
6
```sh
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
10
10
@angular/cli: 6.1.1
11
11
```
12
12
13
-
## Runnning the application
13
+
## Running the application
14
14
15
15
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
Copy file name to clipboardExpand all lines: samples/imagekitio-angular7-sample/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Imagekit Angular 6 Sample
1
+
# Imagekit Angular 7 Sample
2
2
3
-
This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please note that you need to have `@angular/cli v7.*.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
3
+
This project shows the usage of ImageKit Angular SDK in an Angular 7 app. Please note that you need to have `@angular/cli v7.*.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
4
4
5
5
6
6
```sh
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
10
10
@angular/cli: 7.3.8
11
11
```
12
12
13
-
## Runnning the application
13
+
## Running the application
14
14
15
15
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
0 commit comments