diff --git a/angular-meteor/angular-meteor-tests.ts b/angular-meteor/angular-meteor-tests.ts index be75f196b..9ce0a33e9 100644 --- a/angular-meteor/angular-meteor-tests.ts +++ b/angular-meteor/angular-meteor-tests.ts @@ -18,6 +18,7 @@ interface CustomScope extends angular.meteor.IScope { todo: ITodo; todoNotAuto: TodoAngularMeteorObject; + todoSubscribed: TodoAngularMeteorObject; save: (todo: ITodo) => void; saveAll: () =>void; @@ -48,6 +49,7 @@ app.controller("mainCtrl", ['$scope', '$meteor', ($scope: CustomScope, $meteor: $scope.notAutoTodos = $meteor.collection(Todos, false).subscribe("publicTodos"); $scope.todoNotAuto = $meteor.object(Todos, 'TodoID', false); + $scope.todoSubscribed = $meteor.object(Todos, 'TodoID').subscribe('todos'); $scope.todo = $scope.todoNotAuto.getRawObject(); $scope.todoNotAuto.reset(); $scope.todoNotAuto.save($scope.todo).then((data) => { return data == 1; });; diff --git a/angular-meteor/angular-meteor.d.ts b/angular-meteor/angular-meteor.d.ts index 89ae4bc9f..b3f520ac5 100644 --- a/angular-meteor/angular-meteor.d.ts +++ b/angular-meteor/angular-meteor.d.ts @@ -277,6 +277,14 @@ declare module angular.meteor { * The returned object is then safe to use as a parameter for method calls, or anywhere else where the data needs to be converted to JSON. */ getRawObject(): T; + + /** + * A shorten (Syntactic sugar) function for the $meteor.subscribe function. + * Takes only one parameter and not returns a promise like $meteor.subscribe does. + * + * @param subscriptionName - The subscription name to subscribe to. Exactly like the first parameter in $meteor.subscribe service. + */ + subscribe(subscriptionName:string): AngularMeteorObject; } /**