Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e35028b

Browse files
committed
2 parents db8a4ad + 4ea5d8b commit e35028b

1 file changed

Lines changed: 10 additions & 33 deletions

File tree

README.md

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,29 @@ e.g., `<body><app></app></body>`.
6161

6262
### Using Angular 2 in a Meteor app:
6363

64-
This package contains `MeteorModule` module that has providers simplifing development of a Meteor app with Angular 2.
64+
The package contains `MeteorModule` module that has providers simplifing development of a Meteor app with Angular 2.
6565

6666
You can use Meteor collections in the same way as you would do in a regular Meteor app with the Blaze,
6767
the only thing required is to import and use `MeteorModule` from `angular2-meteor`.
68-
After, you you can iterate `Mongo.Cursor` objects with Angular 2.0 ngFor!
68+
After, you you can iterate `Mongo.Cursor` objects with Angular 2.0's `ngFor`!
6969

7070
Below is a valid Angular2-Meteor app:
7171

72-
`client/app.ts`
7372
````ts
74-
import {MeteorModule} from 'angular2-meteor';
73+
import {MeteorModule, MeteorComponent} from 'angular2-meteor';
7574

7675
const Parties = new Mongo.Collection('parties');
77-
76+
7877
@Component({
7978
template: `
8079
<div *ngFor="let party of parties">
8180
<p>Name: {{party.name}}</p>
8281
</div>
8382
`
8483
})
85-
class Socially {
84+
class Socially extends MeteorComponent {
8685
constructor() {
86+
this.subscribe('my-subscription');
8787
this.parties = Parties.find();
8888
}
8989
}
@@ -98,35 +98,12 @@ Below is a valid Angular2-Meteor app:
9898
platformBrowserDynamic().bootstrapModule(AppModule);
9999
````
100100

101-
At this moment, you are ready to create awesome apps backed by the power of Angular 2 and Meteor!
102-
103-
Another part of this package's API is a basic component class called `MeteorComponent`.
104-
105-
`MeteorComponent` wraps major Meteor methods to do some work behind the scene (such as cleanup) for a component that extends it:
106-
107-
````ts
108-
import {MeteorComponent} from 'angular2-meteor';
109-
import {MyCollection} form '../model/my-collection.ts';
110-
111-
@Component({
112-
selector: 'socially'
113-
template: "<p>Hello World!</p>"
114-
})
115-
class Socially extends MeteorComponent {
116-
myData : Mongo.Cursor<any>;
117-
118-
constructor() {
119-
this.myData = MyCollection.find({});
120-
this.subscribe('my-subscription'); // Wraps Meteor.subscribe
121-
}
122-
123-
doSomething() {
124-
this.call('server-method'); // Wraps Meteor.call
125-
}
126-
}
127-
````
101+
`MeteorComponent` wraps major Meteor methods to do some work behind the scene (such as cleanup) for a component that extends it.
128102
You can read more about `MeteorComponent` in the [tutorial section] (http://www.angular-meteor.com/tutorials/socially/angular2/privacy-and-publish-subscribe-functions)!
129103

104+
At this moment, you are almost set to create awesome apps backed by the power of Angular 2 and Meteor!
105+
We recommend to check out our awesome [tutorial](http://www.angular-meteor.com/tutorials/socially/angular2/bootstrapping) in order to create more complex apps that have security and routing.
106+
130107
## Demos
131108

132109
Check out two demos for the quick how-to:

0 commit comments

Comments
 (0)