Skip to content

Commit 5099d1c

Browse files
author
robbiev
committed
Adding helpers to IScope to keep up-to-date with angular-meteor 1.3.1+
1 parent dc9dabe commit 5099d1c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

angular-meteor/angular-meteor.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ declare module angular.meteor {
3939
* @return The promise solved successfully when subscription is ready. The success promise holds the subscription handle.
4040
*/
4141
subscribe(name: string, ...publisherArguments: any[]): angular.IPromise<Meteor.SubscriptionHandle>;
42+
43+
/**
44+
* The helpers method is part of the ReactiveContext, and available on every context and $scope.
45+
* These method are defined as Object, where each key is the name of the variable that will be available on the context we run, and each value is a function with a return value.
46+
* Under the hood, each helper starts a new Tracker.autorun. When its reactive dependencies change, the helper is rerun.
47+
* To trigger a rerun every time an specific Angular variable change, use getReactively](/api/1.3.1/get-reactively) to make your Angular variable reactive inside the helper its used in.
48+
* Each helper function should return a MongoDB Cursor and the helpers will expose it as a normal array to the context.
49+
*
50+
* @param definitions - Object containing `name` => `function` definition, where each name is a string and each function is the helper function. Should return a [MongoDB Cursor](http://docs.meteor.com/#/full/mongo_cursor)
51+
* @return This method returns this, which the the reactive context, in order to provide the ability to chain the logic.
52+
*/
53+
helpers(definitions : { [helperName : string] : () => Mongo.Cursor<any> }): IScope;
4254
}
4355

4456
/**

0 commit comments

Comments
 (0)