Skip to content

Commit 96ffa42

Browse files
author
Amir Tocker
committed
Update sample apps to Angular 4.x. Make all projects use config.ts.
1 parent 283ad95 commit 96ffa42

File tree

18 files changed

+37
-48
lines changed

18 files changed

+37
-48
lines changed

samples/angular-cli-sample/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15+
"@angular/animations": "^4.1.3",
1516
"@angular/common": "^4.0.0",
1617
"@angular/compiler": "^4.0.0",
1718
"@angular/core": "^4.0.0",
@@ -20,6 +21,8 @@
2021
"@angular/platform-browser": "^4.0.0",
2122
"@angular/platform-browser-dynamic": "^4.0.0",
2223
"@angular/router": "^4.0.0",
24+
"@cloudinary/angular-4.x": "^1.0.0",
25+
"cloudinary-core": "^2.3.0",
2326
"core-js": "^2.4.1",
2427
"rxjs": "^5.1.0",
2528
"zone.js": "^0.8.4"

samples/angular-cli-sample/src/app/app.module.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ import { NgModule } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
44
import { HttpModule } from '@angular/http';
55

6-
import { Cloudinary } from 'cloudinary-core';
7-
import { CloudinaryModule } from '@cloudinary/angular';
8-
6+
import * as cloudinary from 'cloudinary-core';
7+
import { CloudinaryModule } from '@cloudinary/angular-4.x';
8+
import cloudinaryConfiguration from './config';
99
import { AppComponent } from './app.component';
1010

11-
export const cloudinaryLib = {
12-
Cloudinary: Cloudinary
13-
};
1411

1512
@NgModule({
1613
declarations: [
@@ -20,7 +17,7 @@ export const cloudinaryLib = {
2017
BrowserModule,
2118
FormsModule,
2219
HttpModule,
23-
CloudinaryModule.forRoot(cloudinaryLib, { cloud_name: 'demo'}),
20+
CloudinaryModule.forRoot(cloudinary, cloudinaryConfiguration),
2421
],
2522
providers: [],
2623
bootstrap: [AppComponent]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
cloud_name: 'CCCCCCC',
3+
upload_preset: 'UUUUUUUU'
4+
};

samples/photo_album/app/js/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, OnInit} from '@angular/core';
2-
import {Cloudinary} from '@cloudinary/angular';
2+
import {Cloudinary} from '@cloudinary/angular-4.x';
33

44
@Component({
55
selector: '.content',
@@ -21,7 +21,7 @@ export class AppComponent implements OnInit {
2121
}
2222

2323
/**
24-
* Hack for having Angular manipulate content in <head> section, which is not bootstrapped by it...
24+
* Hack for having Angular manipulate content in <head> section, which is not bootstrapped by it...
2525
*/
2626
initializeFavicon() {
2727
// Change value of the meta tag

samples/photo_album/app/js/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ import {HttpModule} from '@angular/http';
66
// File upload module
77
import {FileUploadModule} from 'ng2-file-upload';
88
// Cloudinary module
9-
import {CloudinaryModule, CloudinaryConfiguration, provideCloudinary} from '@cloudinary/angular';
9+
import {CloudinaryModule, CloudinaryConfiguration, provideCloudinary} from '@cloudinary/angular-4.x';
1010
// Application modules
1111
import {AppComponent} from './app.component';
1212
import {PhotoListComponent} from './photo-list/photo-list.component';
1313
import {PhotoUploadComponent} from './photo-album/photo-upload.component';
1414
import {PhotoAlbum} from './model/photo-album.service';
1515
import cloudinaryConfiguration from './config';
1616
import {routing} from './app.routing';
17+
import * as cloudinary from 'cloudinary-core';
1718

1819
@NgModule({
1920
imports: [
2021
BrowserModule,
2122
HttpModule,
22-
CloudinaryModule,
23+
CloudinaryModule.forRoot(cloudinary, cloudinaryConfiguration),
2324
FileUploadModule,
2425
routing
2526
],
@@ -30,7 +31,6 @@ import {routing} from './app.routing';
3031
],
3132
providers: [
3233
PhotoAlbum,
33-
provideCloudinary(require('cloudinary-core'), cloudinaryConfiguration as CloudinaryConfiguration)
3434
],
3535
bootstrap: [AppComponent]
3636
})

samples/photo_album/app/js/model/photo-album.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Http, Response} from '@angular/http';
33
import {Observable} from 'rxjs/Observable';
44
import 'rxjs/add/operator/map';
55
import {Photo} from './photo';
6-
import {Cloudinary} from '@cloudinary/angular';
6+
import {Cloudinary} from '@cloudinary/angular-4.x';
77

88
@Injectable()
99
export class PhotoAlbum {

samples/photo_album/app/js/photo-album/photo-upload.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, OnInit, Input, NgZone } from '@angular/core';
22
import { Http, Response, RequestOptions, Headers } from '@angular/http';
33
import { FileUploader, FileUploaderOptions, ParsedResponseHeaders } from 'ng2-file-upload';
44
import 'rxjs/add/operator/toPromise';
5-
import { Cloudinary } from '@cloudinary/angular';
5+
import { Cloudinary } from '@cloudinary/angular-4.x';
66

77
@Component({
88
selector: 'photo-list',

samples/photo_album_aot/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ Alternatively use `yarn install`
2727

2828
## Running ##
2929

30-
Run `npm run clean-aot` to delete AOT compilation artifacts
31-
Run `npm run ngc` to run Angular's AOT compiler
32-
Run `npm run rollup` to bundle the application
30+
Run `npm run clean-aot` to delete AOT compilation artifacts.
31+
32+
Run `npm run ngc` to run Angular's AOT compiler.
33+
34+
Run `npm run rollup` to bundle the application.
35+
3336
Run `npm run lite` to start the server and automatically open a browser and navigate to the application's url.
3437

3538
## Internals ##

samples/photo_album_aot/app/js/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, OnInit} from '@angular/core';
2-
import {Cloudinary} from '@cloudinary/angular';
2+
import {Cloudinary} from '@cloudinary/angular-4.x';
33

44
@Component({
55
moduleId: module.id,
@@ -22,7 +22,7 @@ export class AppComponent implements OnInit {
2222
}
2323

2424
/**
25-
* Hack for having Angular manipulate content in <head> section, which is not bootstrapped by it...
25+
* Hack for having Angular manipulate content in <head> section, which is not bootstrapped by it...
2626
*/
2727
initializeFavicon() {
2828
// Change value of the meta tag

samples/photo_album_aot/app/js/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BrowserModule } from '@angular/platform-browser';
55
import { HttpModule } from '@angular/http';
66
import { RouterModule } from '@angular/router';
77
// Cloudinary module
8-
import { CloudinaryModule } from '@cloudinary/angular';
8+
import { CloudinaryModule } from '@cloudinary/angular-4.x';
99
import { Cloudinary } from 'cloudinary-core/cloudinary-core-shrinkwrap';
1010
// App modules
1111
import { AppComponent } from './app.component';

0 commit comments

Comments
 (0)