Skip to content

Commit 22e00e5

Browse files
committed
Angular-cli sample
1 parent ea03117 commit 22e00e5

25 files changed

+535
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

samples/angular-cli-sample/.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
10+
# IDEs and editors
11+
/.idea
12+
.project
13+
.classpath
14+
.c9/
15+
*.launch
16+
.settings/
17+
18+
# IDE - VSCode
19+
.vscode/*
20+
!.vscode/settings.json
21+
!.vscode/tasks.json
22+
!.vscode/launch.json
23+
!.vscode/extensions.json
24+
25+
# misc
26+
/.sass-cache
27+
/connect.lock
28+
/coverage/*
29+
/libpeerconnection.log
30+
npm-debug.log
31+
testem.log
32+
/typings
33+
34+
# e2e
35+
/e2e/*.js
36+
/e2e/*.map
37+
38+
#System Files
39+
.DS_Store
40+
Thumbs.db

samples/angular-cli-sample/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AngularCliSample
2+
3+
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.26.
4+
5+
## Development server
6+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
8+
## Code scaffolding
9+
10+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
11+
12+
## Build
13+
14+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
15+
16+
## Running unit tests
17+
18+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
19+
20+
## Running end-to-end tests
21+
22+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
23+
Before running the tests make sure you are serving the app via `ng serve`.
24+
25+
## Deploying to GitHub Pages
26+
27+
Run `ng github-pages:deploy` to deploy to GitHub Pages.
28+
29+
## Further help
30+
31+
To get more help on the `angular-cli` use `ng help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"project": {
3+
"version": "1.0.0-beta.26",
4+
"name": "angular-cli-sample"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"test": "test.ts",
17+
"tsconfig": "tsconfig.json",
18+
"prefix": "app",
19+
"mobile": false,
20+
"styles": [
21+
"styles.css"
22+
],
23+
"scripts": [
24+
],
25+
"environments": {
26+
"source": "environments/environment.ts",
27+
"dev": "environments/environment.ts",
28+
"prod": "environments/environment.prod.ts"
29+
}
30+
}
31+
],
32+
"e2e": {
33+
"protractor": {
34+
"config": "./protractor.conf.js"
35+
}
36+
},
37+
"test": {
38+
"karma": {
39+
"config": "./karma.conf.js"
40+
}
41+
},
42+
"defaults": {
43+
"styleExt": "css",
44+
"prefixInterfaces": false,
45+
"inline": {
46+
"style": false,
47+
"template": false
48+
},
49+
"spec": {
50+
"class": false,
51+
"component": true,
52+
"directive": true,
53+
"module": false,
54+
"pipe": true,
55+
"service": true
56+
}
57+
}
58+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AngularCliSamplePage } from './app.po';
2+
3+
describe('angular-cli-sample App', function() {
4+
let page: AngularCliSamplePage;
5+
6+
beforeEach(() => {
7+
page = new AngularCliSamplePage();
8+
});
9+
10+
it('should display message saying app works', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('app works!');
13+
});
14+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, element, by } from 'protractor';
2+
3+
export class AngularCliSamplePage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"declaration": false,
5+
"emitDecoratorMetadata": true,
6+
"experimentalDecorators": true,
7+
"module": "commonjs",
8+
"moduleResolution": "node",
9+
"outDir": "../dist/out-tsc-e2e",
10+
"sourceMap": true,
11+
"target": "es5",
12+
"typeRoots": [
13+
"../node_modules/@types"
14+
]
15+
}
16+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "angular-cli-sample",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"angular-cli": {},
6+
"scripts": {
7+
"ng": "ng",
8+
"start": "ng serve",
9+
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
10+
"test": "ng test",
11+
"pree2e": "webdriver-manager update --standalone false --gecko false",
12+
"e2e": "protractor"
13+
},
14+
"private": true,
15+
"dependencies": {
16+
"@angular/common": "^2.3.1",
17+
"@angular/compiler": "^2.3.1",
18+
"@angular/core": "^2.3.1",
19+
"@angular/forms": "^2.3.1",
20+
"@angular/http": "^2.3.1",
21+
"@angular/platform-browser": "^2.3.1",
22+
"@angular/platform-browser-dynamic": "^2.3.1",
23+
"@angular/router": "^3.3.1",
24+
"@cloudinary/angular": "^2.1.1",
25+
"cloudinary-core": "^2.1.9",
26+
"core-js": "^2.4.1",
27+
"lodash": "^4.17.4",
28+
"rxjs": "^5.0.1",
29+
"ts-helpers": "^1.1.1",
30+
"zone.js": "^0.7.2"
31+
},
32+
"devDependencies": {
33+
"@angular/compiler-cli": "^2.3.1",
34+
"@types/jasmine": "2.5.38",
35+
"@types/node": "^6.0.42",
36+
"angular-cli": "1.0.0-beta.26",
37+
"codelyzer": "~2.0.0-beta.1",
38+
"jasmine-core": "2.5.2",
39+
"jasmine-spec-reporter": "2.5.0",
40+
"karma": "1.2.0",
41+
"karma-chrome-launcher": "^2.0.0",
42+
"karma-cli": "^1.0.1",
43+
"karma-jasmine": "^1.0.2",
44+
"karma-remap-istanbul": "^0.2.1",
45+
"protractor": "~4.0.13",
46+
"ts-node": "1.2.1",
47+
"tslint": "^4.3.0",
48+
"typescript": "~2.0.3"
49+
}
50+
}

samples/angular-cli-sample/src/app/app.component.css

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<h1>
2+
{{title}}
3+
</h1>
4+
<cl-image public-id="sample" width="500">
5+
6+
</cl-image>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* tslint:disable:no-unused-variable */
2+
3+
import { TestBed, async } from '@angular/core/testing';
4+
import { AppComponent } from './app.component';
5+
6+
describe('AppComponent', () => {
7+
beforeEach(() => {
8+
TestBed.configureTestingModule({
9+
declarations: [
10+
AppComponent
11+
],
12+
});
13+
TestBed.compileComponents();
14+
});
15+
16+
it('should create the app', async(() => {
17+
const fixture = TestBed.createComponent(AppComponent);
18+
const app = fixture.debugElement.componentInstance;
19+
expect(app).toBeTruthy();
20+
}));
21+
22+
it(`should have as title 'app works!'`, async(() => {
23+
const fixture = TestBed.createComponent(AppComponent);
24+
const app = fixture.debugElement.componentInstance;
25+
expect(app.title).toEqual('app works!');
26+
}));
27+
28+
it('should render title in a h1 tag', async(() => {
29+
const fixture = TestBed.createComponent(AppComponent);
30+
fixture.detectChanges();
31+
const compiled = fixture.debugElement.nativeElement;
32+
expect(compiled.querySelector('h1').textContent).toContain('app works!');
33+
}));
34+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.css']
7+
})
8+
export class AppComponent {
9+
title = 'app works!';
10+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
import { FormsModule } from '@angular/forms';
4+
import { HttpModule } from '@angular/http';
5+
6+
import { CloudinaryModule } from '@cloudinary/angular';
7+
8+
import { AppComponent } from './app.component';
9+
10+
import * as Cloudinary from 'cloudinary-core';
11+
12+
@NgModule({
13+
declarations: [
14+
AppComponent
15+
],
16+
imports: [
17+
BrowserModule,
18+
FormsModule,
19+
HttpModule,
20+
CloudinaryModule.forRoot(Cloudinary, { cloud_name: 'demo'}),
21+
],
22+
providers: [],
23+
bootstrap: [AppComponent]
24+
})
25+
export class AppModule { }

samples/angular-cli-sample/src/assets/.gitkeep

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// The file contents for the current environment will overwrite these during build.
2+
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3+
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4+
// The list of which env maps to which file can be found in `angular-cli.json`.
5+
6+
export const environment = {
7+
production: false
8+
};
5.3 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>AngularCliSample</title>
6+
<base href="/">
7+
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel="icon" type="image/x-icon" href="favicon.ico">
10+
</head>
11+
<body>
12+
<app-root>Loading...</app-root>
13+
</body>
14+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import './polyfills.ts';
2+
3+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4+
import { enableProdMode } from '@angular/core';
5+
import { environment } from './environments/environment';
6+
import { AppModule } from './app/app.module';
7+
8+
if (environment.production) {
9+
enableProdMode();
10+
}
11+
12+
platformBrowserDynamic().bootstrapModule(AppModule);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This file includes polyfills needed by Angular and is loaded before
2+
// the app. You can add your own extra polyfills to this file.
3+
import 'core-js/es6/symbol';
4+
import 'core-js/es6/object';
5+
import 'core-js/es6/function';
6+
import 'core-js/es6/parse-int';
7+
import 'core-js/es6/parse-float';
8+
import 'core-js/es6/number';
9+
import 'core-js/es6/math';
10+
import 'core-js/es6/string';
11+
import 'core-js/es6/date';
12+
import 'core-js/es6/array';
13+
import 'core-js/es6/regexp';
14+
import 'core-js/es6/map';
15+
import 'core-js/es6/set';
16+
import 'core-js/es6/reflect';
17+
18+
import 'core-js/es7/reflect';
19+
import 'zone.js/dist/zone';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* You can add global styles to this file, and also import other style files */

0 commit comments

Comments
 (0)