diff --git a/test-project/src/main/scala/net/liftmodules/ng/test/comet/BindingActors.scala b/test-project/src/main/scala/net/liftmodules/ng/test/comet/BindingActors.scala index 8a3b61d1..1954d0b5 100644 --- a/test-project/src/main/scala/net/liftmodules/ng/test/comet/BindingActors.scala +++ b/test-project/src/main/scala/net/liftmodules/ng/test/comet/BindingActors.scala @@ -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 \ No newline at end of file diff --git a/test-project/src/main/scala/net/liftmodules/ng/test/snippet/EmbeddedFuturesSnips.scala b/test-project/src/main/scala/net/liftmodules/ng/test/snippet/EmbeddedFuturesSnips.scala index c2a2ec3d..758a76df 100644 --- a/test-project/src/main/scala/net/liftmodules/ng/test/snippet/EmbeddedFuturesSnips.scala +++ b/test-project/src/main/scala/net/liftmodules/ng/test/snippet/EmbeddedFuturesSnips.scala @@ -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")) diff --git a/test-project/src/main/webapp/js/EmbeddedFuturesApp.js b/test-project/src/main/webapp/js/EmbeddedFuturesApp.js index 806b53db..cfd9a079 100644 --- a/test-project/src/main/webapp/js/EmbeddedFuturesApp.js +++ b/test-project/src/main/webapp/js/EmbeddedFuturesApp.js @@ -69,6 +69,9 @@ 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")); @@ -76,6 +79,8 @@ angular.module('EmbeddedFuturesApp', ['lift-ng', 'EmbeddedFutures']) 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"));