Skip to content

Commit 69656a4

Browse files
authored
Update Angular CLI sample to support AOT (#78)
* Upgrade angular-cli to ^1.0.0-rc.1 * Upgrade yarn dependencies * Update angular CLI sample to support AOT. Fixes #76, #77
1 parent ab07e4f commit 69656a4

File tree

5 files changed

+5535
-20
lines changed

5 files changed

+5535
-20
lines changed

samples/angular-cli-sample/angular-cli.json renamed to samples/angular-cli-sample/.angular-cli.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"project": {
3-
"version": "1.0.0-beta.26",
43
"name": "angular-cli-sample"
54
},
65
"apps": [
@@ -15,15 +14,15 @@
1514
"main": "main.ts",
1615
"test": "test.ts",
1716
"tsconfig": "tsconfig.json",
17+
"testTsconfig": "tsconfig.json",
1818
"prefix": "app",
19-
"mobile": false,
2019
"styles": [
2120
"styles.css"
2221
],
2322
"scripts": [
2423
],
24+
"environmentSource": "environments/environment.ts",
2525
"environments": {
26-
"source": "environments/environment.ts",
2726
"dev": "environments/environment.ts",
2827
"prod": "environments/environment.prod.ts"
2928
}
@@ -41,18 +40,13 @@
4140
},
4241
"defaults": {
4342
"styleExt": "css",
44-
"prefixInterfaces": false,
45-
"inline": {
46-
"style": false,
47-
"template": false
43+
"class": {
44+
"spec": false
4845
},
49-
"spec": {
50-
"class": false,
51-
"component": true,
52-
"directive": true,
53-
"module": false,
54-
"pipe": true,
55-
"service": true
46+
"component": {
47+
"spec": true,
48+
"inlineStyle": false,
49+
"inlineTemplate": false
5650
}
5751
}
5852
}

samples/angular-cli-sample/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"angular-cli": {},
66
"scripts": {
77
"ng": "ng",
8-
"start": "ng serve",
8+
"start": "ng serve --aot --progres --target=production",
9+
"build": "ng build --aot --progres --target=production",
910
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
1011
"test": "ng test",
1112
"pree2e": "webdriver-manager update --standalone false --gecko false",
@@ -22,18 +23,18 @@
2223
"@angular/platform-browser-dynamic": "^2.3.1",
2324
"@angular/router": "^3.3.1",
2425
"@cloudinary/angular": "^2.1.1",
25-
"cloudinary-core": "^2.1.9",
26+
"cloudinary-core": "^2.3.0",
2627
"core-js": "^2.4.1",
2728
"lodash": "^4.17.4",
2829
"rxjs": "^5.0.1",
2930
"ts-helpers": "^1.1.1",
3031
"zone.js": "^0.7.2"
3132
},
3233
"devDependencies": {
34+
"@angular/cli": "^1.0.0-rc.1",
3335
"@angular/compiler-cli": "^2.3.1",
3436
"@types/jasmine": "2.5.38",
3537
"@types/node": "^6.0.42",
36-
"angular-cli": "1.0.0-beta.26",
3738
"codelyzer": "~2.0.0-beta.1",
3839
"jasmine-core": "2.5.2",
3940
"jasmine-spec-reporter": "2.5.0",

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

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

6+
import { Cloudinary } from 'cloudinary-core';
67
import { CloudinaryModule } from '@cloudinary/angular';
78

89
import { AppComponent } from './app.component';
910

10-
import * as Cloudinary from 'cloudinary-core';
11+
export const cloudinaryLib = {
12+
Cloudinary: Cloudinary
13+
};
1114

1215
@NgModule({
1316
declarations: [
@@ -17,7 +20,7 @@ import * as Cloudinary from 'cloudinary-core';
1720
BrowserModule,
1821
FormsModule,
1922
HttpModule,
20-
CloudinaryModule.forRoot(Cloudinary, { cloud_name: 'demo'}),
23+
CloudinaryModule.forRoot(cloudinaryLib, { cloud_name: 'demo'}),
2124
],
2225
providers: [],
2326
bootstrap: [AppComponent]

samples/angular-cli-sample/src/typings.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)