mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Add test for subscribe on single object
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; });;
|
||||
|
||||
Reference in New Issue
Block a user