mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-26 11:12:19 +08:00
Merge pull request #1 from sigita42/patch-1
Subscribe should work also on AngularMeteorObject
This commit is contained in:
@@ -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 = <TodoAngularMeteorObject>$meteor.object(Todos, 'TodoID', false);
|
||||
$scope.todoSubscribed = <TodoAngularMeteorObject>$meteor.object(Todos, 'TodoID').subscribe('todos');
|
||||
$scope.todo = $scope.todoNotAuto.getRawObject();
|
||||
$scope.todoNotAuto.reset();
|
||||
$scope.todoNotAuto.save($scope.todo).then((data) => { return data == 1; });;
|
||||
|
||||
Vendored
+8
@@ -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<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user