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

Commit 3b15fe7

Browse files
committed
chore(demo): update to work with latest
1 parent 3acc97c commit 3b15fe7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

demo/web/main.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import 'dart:math' as math;
66
class AngularBootstrap {
77
Compiler $compile;
88
Scope $rootScope;
9+
Injector injector;
910

10-
AngularBootstrap(Compiler this.$compile, Scope this.$rootScope);
11+
AngularBootstrap(Compiler this.$compile, Scope this.$rootScope, Injector this.injector);
1112

1213
call() {
1314
List<dom.Node> topElt = dom.query('[ng-app]').nodes.toList();
@@ -23,8 +24,8 @@ class AngularBootstrap {
2324
$rootScope['people'] = ['James', 'Misko'];
2425
$rootScope['objs'] = [{'v': 'v1'}, {'v': 'v2'}];
2526

26-
var template = $compile.call(topElt);
27-
template.call(topElt).attach($rootScope);
27+
var template = $compile(topElt);
28+
template(injector, topElt);
2829

2930
// Digest the scope.
3031
$rootScope.$digest();
@@ -84,10 +85,10 @@ class ChapterDirective {
8485
main() {
8586
// Set up the Angular directives.
8687
var module = new AngularModule()
87-
..register(NgBindAttrDirective)
88-
..register(NgRepeatAttrDirective)
89-
..register(BookComponent)
90-
..register(ChapterDirective);
88+
..directive(NgBindAttrDirective)
89+
..directive(NgRepeatAttrDirective)
90+
..directive(BookComponent)
91+
..directive(ChapterDirective);
9192
Injector injector = new Injector([module]);
9293
injector.get(AngularBootstrap)();
9394
}

0 commit comments

Comments
 (0)