Skip to content

Commit

Permalink
[embedded futures] AngularActor doesn't do plumbing.inject on model c…
Browse files Browse the repository at this point in the history
…hange - reproduced
  • Loading branch information
arkadius committed Dec 30, 2014
1 parent dadb9df commit d5353e2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ with BindingToClient with BindingToServer {
}
}

class EmbeddedFuturesBinder extends SimpleNgModelBinder[EmbeddedFutures] ("bound", EmbeddedFuturesSnips.buildModel) with BindingToClient
class EmbeddedFuturesBinder extends SimpleNgModelBinder[EmbeddedFutures] ("bound", EmbeddedFuturesSnips.buildEmptyModel) with BindingToClient {
this ! EmbeddedFuturesSnips.buildModel
}

class MultipleBinder1 extends SimpleNgModelBinder("bound1", Message("Bound-1")) with BindingToClient
class MultipleBinder2 extends SimpleNgModelBinder("bound2", Message("Bound-2")) with BindingToClient
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ object EmbeddedFuturesSnips {
)
)

def buildEmptyModel = {
EmbeddedFutures(emptyFuture, emptyFuture, emptyFuture, emptyFuture, List(emptyFuture, emptyFuture), emptyFuture)
}

def emptyFuture[T]: LAFuture[Box[T]] = {
val future = new LAFuture[Box[T]]
future.satisfy(Empty)
future
}


def buildModel = {
val resolved = new LAFuture[Box[String]]
resolved.satisfy(Full("resolved"))
Expand Down
5 changes: 5 additions & 0 deletions test-project/src/main/webapp/js/EmbeddedFuturesApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ angular.module('EmbeddedFuturesApp', ['lift-ng', 'EmbeddedFutures'])
};

$scope.$watch('bound', function(obj){
if (typeof obj == 'undefined')
return;
console.log("bound was changed to: ", obj);
obj.resolved.then(binding("resolved"));
obj.failed.catch(binding("failed"));
obj.string.then(binding("string"));
obj.obj.then(binding("obj"));
obj.arr[0].then(binding("arr0"));
obj.arr[1].then(binding("arr1"));
obj.fobj.then(function(fobj){
if (typeof fobj == 'undefined')
return;
fobj.resolved.then(binding("fobj_resolved"));
fobj.failed.catch(binding("fobj_failed"));
fobj.string.then(binding("fobj_string"));
Expand Down

0 comments on commit d5353e2

Please sign in to comment.