Skip to content

Commit e27b848

Browse files
committed
initial push for step 60
1 parent 3718a0e commit e27b848

24 files changed

+6916
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

step60_firebase_one_to_many/app/app.component.js

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

step60_firebase_one_to_many/app/app.component.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { Component } from '@angular/core';
2+
import { AngularFire, FirebaseRef, FirebaseObjectObservable, FirebaseListObservable } from 'angularfire2';
3+
import {Observable} from 'Rxjs';
4+
5+
@Component({
6+
selector: 'my-app',
7+
template: `<h1>My First Angular 2 App</h1>
8+
<ul>
9+
<li class="text" *ngFor="let item of ziaFriends | async">
10+
{{item.$value}}
11+
</li>
12+
</ul>
13+
`
14+
})
15+
export class AppComponent {
16+
af: AngularFire;
17+
users: FirebaseObjectObservable<any>;
18+
ziaFriends: Observable<any[]>;
19+
constructor(af: AngularFire) {
20+
this.af = af;
21+
this.users = af.database.object('users');
22+
this.populateDB();
23+
this.ziaFriends = af.database.list('users/zia/friends').map(function(value: any[]){
24+
return value.map((val) => af.database.object('users/zia/friends/' + val));
25+
}
26+
27+
}
28+
29+
populateDB(){
30+
let jsonObject = {
31+
zia:
32+
{
33+
name: "Zia Khan",
34+
friends: {
35+
"inam": true,
36+
"zeeshan": true
37+
}
38+
}
39+
},
40+
inam:
41+
{
42+
name: "Inam Ul Haq",
43+
},
44+
zeeshan: {
45+
name: "Zeeshan Hanif"
46+
};
47+
this.users.update(jsonObject);
48+
}
49+
50+
}
51+

step60_firebase_one_to_many/app/main.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

step60_firebase_one_to_many/app/main.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { bootstrap } from '@angular/platform-browser-dynamic';
2+
import { AppComponent } from './app.component';
3+
import { FIREBASE_PROVIDERS, defaultFirebase } from 'angularfire2';
4+
5+
6+
bootstrap(AppComponent, [
7+
FIREBASE_PROVIDERS,
8+
// Initialize Firebase app
9+
defaultFirebase({
10+
apiKey: "AIzaSyBfPPVdQLUnAq2yJC3yEg2rEdclksJdxvA",
11+
authDomain: "quickstart-db.firebaseapp.com",
12+
databaseURL: "https://quickstart-db.firebaseio.com",
13+
storageBucket: "quickstart-db.appspot.com",
14+
})
15+
]);
16+
17+
18+
19+
20+
21+
22+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<html>
2+
<head>
3+
<title>Angular 2 QuickStart</title>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="stylesheet" href="styles.css">
7+
<!-- 1. Load libraries -->
8+
<!-- Polyfill(s) for older browsers -->
9+
<script src="node_modules/core-js/client/shim.min.js"></script>
10+
<script src="node_modules/zone.js/dist/zone.js"></script>
11+
<script src="node_modules/reflect-metadata/Reflect.js"></script>
12+
<script src="node_modules/systemjs/dist/system.src.js"></script>
13+
<!-- 2. Configure SystemJS -->
14+
<script src="systemjs.config.js"></script>
15+
<script>
16+
System.import('app').catch(function(err){ console.error(err); });
17+
</script>
18+
</head>
19+
<!-- 3. Display the application -->
20+
<body>
21+
<my-app>Loading...</my-app>
22+
</body>
23+
</html>
24+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
0 info it worked if it ends with ok
2+
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
3+
2 info using npm@3.6.0
4+
3 info using node@v5.6.0
5+
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
6+
5 info lifecycle angular2-quickstart@1.0.0~prestart: angular2-quickstart@1.0.0
7+
6 silly lifecycle angular2-quickstart@1.0.0~prestart: no script for prestart, continuing
8+
7 info lifecycle angular2-quickstart@1.0.0~start: angular2-quickstart@1.0.0
9+
8 verbose lifecycle angular2-quickstart@1.0.0~start: unsafe-perm in lifecycle true
10+
9 verbose lifecycle angular2-quickstart@1.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ZiaKhan/learn-angular2/step60_firebase_one_to_many/node_modules/.bin:/Users/ZiaKhan/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/users/ZiaKhan/.cargo/bin:/users/ZiaKhan/apache-ant-1.9.4/bin:/users/ZiaKhan/Library/Android/sdk/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
11+
10 verbose lifecycle angular2-quickstart@1.0.0~start: CWD: /Users/ZiaKhan/learn-angular2/step60_firebase_one_to_many
12+
11 silly lifecycle angular2-quickstart@1.0.0~start: Args: [ '-c', 'tsc && concurrently "npm run tsc:w" "npm run lite" ' ]
13+
12 silly lifecycle angular2-quickstart@1.0.0~start: Returned: code: 2 signal: null
14+
13 info lifecycle angular2-quickstart@1.0.0~start: Failed to exec start script
15+
14 verbose stack Error: angular2-quickstart@1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
16+
14 verbose stack Exit status 2
17+
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
18+
14 verbose stack at emitTwo (events.js:100:13)
19+
14 verbose stack at EventEmitter.emit (events.js:185:7)
20+
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
21+
14 verbose stack at emitTwo (events.js:100:13)
22+
14 verbose stack at ChildProcess.emit (events.js:185:7)
23+
14 verbose stack at maybeClose (internal/child_process.js:827:16)
24+
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
25+
15 verbose pkgid angular2-quickstart@1.0.0
26+
16 verbose cwd /Users/ZiaKhan/learn-angular2/step60_firebase_one_to_many
27+
17 error Darwin 15.5.0
28+
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
29+
19 error node v5.6.0
30+
20 error npm v3.6.0
31+
21 error code ELIFECYCLE
32+
22 error angular2-quickstart@1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
33+
22 error Exit status 2
34+
23 error Failed at the angular2-quickstart@1.0.0 start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
35+
23 error Make sure you have the latest version of node.js and npm installed.
36+
23 error If you do, this is most likely a problem with the angular2-quickstart package,
37+
23 error not with npm itself.
38+
23 error Tell the author that this fails on your system:
39+
23 error tsc && concurrently "npm run tsc:w" "npm run lite"
40+
23 error You can get information on how to open an issue for this project with:
41+
23 error npm bugs angular2-quickstart
42+
23 error Or if that isn't available, you can get their info via:
43+
23 error npm owner ls angular2-quickstart
44+
23 error There is likely additional logging output above.
45+
24 verbose exit [ 1, true ]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "angular2-quickstart",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
6+
"lite": "lite-server",
7+
"postinstall": "typings install",
8+
"tsc": "tsc",
9+
"tsc:w": "tsc -w",
10+
"typings": "typings"
11+
},
12+
"license": "ISC",
13+
"dependencies": {
14+
"@angular/common": "2.0.0-rc.4",
15+
"@angular/compiler": "2.0.0-rc.4",
16+
"@angular/core": "2.0.0-rc.4",
17+
"@angular/forms": "0.2.0",
18+
"@angular/http": "2.0.0-rc.4",
19+
"@angular/platform-browser": "2.0.0-rc.4",
20+
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
21+
"@angular/router": "3.0.0-beta.1",
22+
"@angular/upgrade": "2.0.0-rc.4",
23+
"angular2-in-memory-web-api": "0.0.14",
24+
"angularfire2": "^2.0.0-beta.2",
25+
"bootstrap": "^3.3.6",
26+
"core-js": "^2.4.0",
27+
"firebase": "^3.2.0",
28+
"reflect-metadata": "^0.1.3",
29+
"rxjs": "5.0.0-beta.6",
30+
"systemjs": "0.19.27",
31+
"zone.js": "^0.6.12"
32+
},
33+
"devDependencies": {
34+
"concurrently": "^2.0.0",
35+
"lite-server": "^2.2.0",
36+
"typescript": "^1.8.10",
37+
"typings": "^1.0.4"
38+
}
39+
}

0 commit comments

Comments
 (0)