-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples(angular2): Added angular2+meteor-ngrx with OnPush example
- Loading branch information
1 parent
7c034f1
commit 9d97b51
Showing
23 changed files
with
359 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
.meteor/local | ||
npm-debug.log | ||
typings | ||
.idea | ||
.meteor/local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file contains information which helps Meteor properly upgrade your | ||
# app when you run 'meteor update'. You should check it into version control | ||
# with your project. | ||
|
||
notices-for-0.9.0 | ||
notices-for-0.9.1 | ||
0.9.4-platform-file | ||
notices-for-facebook-graph-api-2 | ||
1.2.0-standard-minifiers-package | ||
1.2.0-meteor-platform-split | ||
1.2.0-cordova-changes | ||
1.2.0-breaking-changes | ||
1.3.0-split-minifiers-package | ||
1.3.5-remove-old-dev-bundle-link | ||
1.4.0-remove-old-dev-bundle-link | ||
1.4.1-add-shell-server-package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dev_bundle | ||
local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file contains a token that is unique to your project. | ||
# Check it into your repository along with the rest of this directory. | ||
# It can be used for purposes such as: | ||
# - ensuring you don't accidentally deploy one app on top of another | ||
# - providing package authors with aggregated statistics | ||
|
||
a4kqps1d5y31214lew0l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Meteor packages used by this project, one per line. | ||
# Check this file (and the other files in this directory) into your repository. | ||
# | ||
# 'meteor add' and 'meteor remove' will edit this file for you, | ||
# but you can also edit it by hand. | ||
|
||
[email protected] # Packages every Meteor app needs to have | ||
[email protected] # Packages for a great mobile UX | ||
[email protected] # The database Meteor supports right now | ||
[email protected] # Reactive variable for tracker | ||
[email protected] # Meteor's client-side reactive programming library | ||
|
||
[email protected] # CSS minifier run for production mode | ||
[email protected] # JS minifier run for production mode | ||
[email protected] # ECMAScript 5 compatibility for older browsers. | ||
|
||
[email protected] # Publish all data to the clients (for prototyping) | ||
[email protected] # Allow all DB writes from clients (for prototyping) | ||
angular2-compilers | ||
practicalmeteor:mocha | ||
xolvio:cleaner | ||
hwillson:stub-collections | ||
dispatch:mocha-phantomjs | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
server | ||
browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { MongoObservable } from "meteor-rxjs"; | ||
import {Demo} from "../models/demo.model"; | ||
|
||
export const DemoCollection = new MongoObservable.Collection<Demo>("demo-collection"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Demo { | ||
name: string; | ||
age: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div> | ||
<h1>Angular 2 with Meteor-RxJS Example</h1> | ||
<br/> | ||
Items: | ||
<ul> | ||
<li *ngFor="let item of items | async"> | ||
{{ item._id }} | ||
</li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
app { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {Component, ChangeDetectionStrategy} from "@angular/core"; | ||
import template from "./app.component.html"; | ||
import style from "./app.component.scss"; | ||
import {MeteorObservable} from "../../../../../src/MeteorObservable"; | ||
import {DemoCollection} from "../../../both/collections/demo.collection"; | ||
|
||
@Component({ | ||
selector: "app", | ||
template, | ||
styles: [ style ], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class AppComponent { | ||
items = DemoCollection.find({}); | ||
|
||
constructor() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { NgModule } from "@angular/core"; | ||
import { BrowserModule } from "@angular/platform-browser"; | ||
import { AppComponent } from "./app.component"; | ||
|
||
@NgModule({ | ||
// Components, Pipes, Directive | ||
declarations: [ | ||
AppComponent | ||
], | ||
// Entry Components | ||
entryComponents: [ | ||
AppComponent | ||
], | ||
// Providers | ||
providers: [ | ||
|
||
], | ||
// Modules | ||
imports: [ | ||
BrowserModule | ||
], | ||
// Main Component | ||
bootstrap: [ AppComponent ] | ||
}) | ||
export class AppModule { | ||
constructor() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./app.component"; | ||
export * from "./app.module"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<head> | ||
<base href="/"> | ||
</head> | ||
<body> | ||
<app>Loading...</app> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import "angular2-meteor-polyfills"; | ||
|
||
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; | ||
import { enableProdMode } from "@angular/core"; | ||
import { Meteor } from "meteor/meteor"; | ||
import { AppModule } from "./imports/app"; | ||
|
||
enableProdMode(); | ||
|
||
Meteor.startup(() => { | ||
platformBrowserDynamic().bootstrapModule(AppModule); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body, html { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "angular2-meteor-rxjs-example", | ||
"private": true, | ||
"scripts": { | ||
"start": "meteor run", | ||
"start:prod": "meteor run --production", | ||
"build": "meteor build ./build/", | ||
"clear": "meteor reset", | ||
"meteor:update": "meteor update --all-packages", | ||
"test": "meteor test --driver-package practicalmeteor:mocha", | ||
"test:ci": "meteor test --once --driver-package dispatch:mocha-phantomjs" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^3.4.33", | ||
"@types/mocha": "^2.2.32", | ||
"chai": "3.5.0", | ||
"chai-spies": "0.7.1" | ||
}, | ||
"dependencies": { | ||
"@angular/common": "2.1.2", | ||
"@angular/compiler": "2.1.2", | ||
"@angular/core": "2.1.2", | ||
"@angular/forms": "2.1.2", | ||
"@angular/platform-browser": "2.1.2", | ||
"@angular/platform-browser-dynamic": "2.1.2", | ||
"@angular/router": "3.1.2", | ||
"angular2-meteor": "0.7.0", | ||
"angular2-meteor-polyfills": "0.1.1", | ||
"angular2-meteor-tests-polyfills": "0.0.2", | ||
"meteor-node-stubs": "0.2.3", | ||
"meteor-rxjs": "../../", | ||
"reflect-metadata": "0.1.8", | ||
"rxjs": "5.0.0-beta.12", | ||
"zone.js": "0.6.26", | ||
"meteor-typings": "1.3.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {DemoCollection} from "../../../both/collections/demo.collection"; | ||
import {Demo} from "../../../both/models/demo.model"; | ||
|
||
export class Main { | ||
start(): void { | ||
this.initFakeData(); | ||
} | ||
|
||
initFakeData(): void { | ||
if (DemoCollection.find({}).cursor.count() === 0) { | ||
const data: Demo[] = [{ | ||
name: "Dotan", | ||
age: 25 | ||
}, { | ||
name: "Liran", | ||
age: 26 | ||
}, { | ||
name: "Uri", | ||
age: 30 | ||
}]; | ||
data.forEach((obj: Demo) => { | ||
DemoCollection.insert(obj); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Main } from "./imports/server-main/main"; | ||
|
||
const mainInstance = new Main(); | ||
mainInstance.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": [ | ||
"es6", | ||
"dom" | ||
], | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"sourceMap": true | ||
}, | ||
"exclude": [ | ||
"node_modules" | ||
], | ||
"files": [ | ||
"typings.d.ts" | ||
], | ||
"compileOnSave": false, | ||
"angularCompilerOptions": { | ||
"genDir": "aot", | ||
"skipMetadataEmit": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/// <reference types="zone.js" /> | ||
/// <reference types="meteor-typings" /> | ||
/// <reference types="@types/underscore" /> | ||
|
||
declare module "*.html" { | ||
const template: string; | ||
export default template; | ||
} | ||
|
||
declare module "*.scss" { | ||
const style: string; | ||
export default style; | ||
} | ||
|
||
declare module "*.less" { | ||
const style: string; | ||
export default style; | ||
} | ||
|
||
declare module "*.css" { | ||
const style: string; | ||
export default style; | ||
} | ||
|
||
declare module "*.sass" { | ||
const style: string; | ||
export default style; | ||
} | ||
|