Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
chore(demo): update to work with new scope
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Feb 20, 2014
1 parent e4dfb46 commit c3f9395
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 29 deletions.
14 changes: 7 additions & 7 deletions demo/bouncing_balls/bouncy_balls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class BounceController {
var run = true;
var fps = 0;
var digestTime = 0;
var currentDigestTime = 0;
var balls = [];
var zone;
var scope;
Expand Down Expand Up @@ -71,9 +72,10 @@ class BounceController {

timeDigest() {
var start = window.performance.now();
scope.runAsync(() {
digestTime = (window.performance.now() - start).round();
}, outsideDigest: true);
digestTime = currentDigestTime;
scope.rootScope.domRead(() {
currentDigestTime = (window.performance.now() - start).round();
});
}

tick() {
Expand Down Expand Up @@ -109,10 +111,8 @@ class BallPositionDirective {

set position(BallModel model) {
element.style.backgroundColor = model.color;
scope.watch(() {
element.style.left = '${model.x + 10}px';
element.style.top = '${model.y + 10}px';
});
scope.observe('x', (x, _) => element.style.left = '${x + 10}px', context:model);
scope.observe('y', (y, _) => element.style.top = '${y + 10}px', context:model);
}
}

Expand Down
38 changes: 17 additions & 21 deletions demo/bouncing_balls/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,40 @@ packages:
description: analyzer
source: hosted
version: "0.10.5"
analyzer_experimental:
description: analyzer_experimental
source: hosted
version: "0.8.6"
angular:
description:
path: "/usr/local/google/gits/angular-dart/demo/bouncing_balls/../.."
path: "../.."
relative: true
source: path
version: "0.9.3"
version: "0.9.7"
args:
description: args
source: hosted
version: "0.9.0"
browser:
description: browser
source: hosted
version: "0.8.7"
version: "0.9.1"
collection:
description: collection
source: hosted
version: "0.9.0"
version: "0.9.1"
di:
description: di
source: hosted
version: "0.0.24"
version: "0.0.32"
html5lib:
description: html5lib
source: hosted
version: "0.8.7"
version: "0.9.1"
intl:
description: intl
source: hosted
version: "0.8.7"
version: "0.9.1"
logging:
description: logging
source: hosted
version: "0.9.1+1"
meta:
description: meta
source: hosted
version: "0.8.7"
path:
description: path
source: hosted
Expand All @@ -58,24 +50,28 @@ packages:
route_hierarchical:
description: route_hierarchical
source: hosted
version: "0.4.7"
version: "0.4.14"
shadow_dom:
description: shadow_dom
source: hosted
version: "0.9.1"
source_maps:
description: source_maps
source: hosted
version: "0.8.7"
version: "0.9.0"
stack_trace:
description: stack_trace
source: hosted
version: "0.8.7"
version: "0.9.1"
unittest:
description: unittest
source: hosted
version: "0.8.7"
version: "0.10.0"
unmodifiable_collection:
description: unmodifiable_collection
source: hosted
version: "0.9.2"
version: "0.9.2+1"
utf:
description: utf
source: hosted
version: "0.8.7"
version: "0.9.0"
77 changes: 77 additions & 0 deletions demo/helloworld/pubspec.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Generated by pub
# See http://pub.dartlang.org/doc/glossary.html#lockfile
packages:
analyzer:
description: analyzer
source: hosted
version: "0.10.5"
angular:
description:
path: "../.."
relative: true
source: path
version: "0.9.7"
args:
description: args
source: hosted
version: "0.9.0"
browser:
description: browser
source: hosted
version: "0.9.1"
collection:
description: collection
source: hosted
version: "0.9.1"
di:
description: di
source: hosted
version: "0.0.32"
html5lib:
description: html5lib
source: hosted
version: "0.9.1"
intl:
description: intl
source: hosted
version: "0.9.1"
logging:
description: logging
source: hosted
version: "0.9.1+1"
path:
description: path
source: hosted
version: "1.0.0"
perf_api:
description: perf_api
source: hosted
version: "0.0.8"
route_hierarchical:
description: route_hierarchical
source: hosted
version: "0.4.14"
shadow_dom:
description: shadow_dom
source: hosted
version: "0.9.1"
source_maps:
description: source_maps
source: hosted
version: "0.9.0"
stack_trace:
description: stack_trace
source: hosted
version: "0.9.1"
unittest:
description: unittest
source: hosted
version: "0.10.0"
unmodifiable_collection:
description: unmodifiable_collection
source: hosted
version: "0.9.2+1"
utf:
description: utf
source: hosted
version: "0.9.0"
2 changes: 1 addition & 1 deletion demo/todo/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ packages:
route_hierarchical:
description: route_hierarchical
source: hosted
version: "0.4.13"
version: "0.4.14"
shadow_dom:
description: shadow_dom
source: hosted
Expand Down

0 comments on commit c3f9395

Please sign in to comment.