Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions demo/bouncy_balls/bouncy_balls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class BallModel {

}

@NgController(
selector: '[bounce-controller]',
publishAs: 'bounce'
)
class BounceController {
var lastTime = window.performance.now();
var run = true;
Expand All @@ -35,7 +39,7 @@ class BounceController {
var scope;
var ballClassName = 'ball';

BounceController(Zone this.zone, Scope this.scope) {
BounceController(NgZone this.zone, Scope this.scope) {
changeCount(100);
tick();
}
Expand Down Expand Up @@ -95,7 +99,7 @@ class BounceController {
@NgDirective(
selector: '[ball-position]',
map: const {
"ballPosition": '=.position'
"ballPosition": '=>position'
}
)
class BallPositionDirective {
Expand All @@ -112,11 +116,13 @@ class BallPositionDirective {
}
}

main() {
var ngModule = new AngularModule();

ngModule.controller('Bounce', BounceController);
ngModule.directive(BallPositionDirective);
class MyModule extends Module {
MyModule() {
type(BounceController);
type(BallPositionDirective);
}
}

bootstrapAngular([ngModule]);
main() {
ngBootstrap(module: new MyModule());
}
2 changes: 1 addition & 1 deletion demo/bouncy_balls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</style>
</head>
<body ng-app>
<div ng-controller="Bounce as bounce">
<div bounce-controller>
<div class="balls">
<div ng-repeat="ball in bounce.balls"
class="{{bounce.ballClassName}}"
Expand Down