From 280d5d0aa5ca28384cbbc00f0f122167772185fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20D=C3=B6hring?= Date: Fri, 14 Jun 2013 12:24:19 +0300 Subject: [PATCH 1/5] Update main.dart Directives -> DirectiveRegistry --- demo/web/main.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/web/main.dart b/demo/web/main.dart index 2f2a0594c..32122aac7 100644 --- a/demo/web/main.dart +++ b/demo/web/main.dart @@ -6,9 +6,9 @@ import 'dart:math' as math; class AngularBootstrap { Compiler $compile; Scope $rootScope; - Directives directives; + DirectiveRegistry directives; - AngularBootstrap(Compiler this.$compile, Scope this.$rootScope, Directives this.directives); + AngularBootstrap(Compiler this.$compile, Scope this.$rootScope, DirectiveRegistry this.directives); call() { List topElt = dom.query('[ng-app]').nodes.toList(); @@ -87,7 +87,7 @@ main() { module.value(Expando, new Expando()); angularModule(module); Injector injector = new Injector([module]); - Directives directives = injector.get(Directives); + DirectiveRegistry directives = injector.get(DirectiveRegistry); directives.register(NgBindAttrDirective); directives.register(NgRepeatAttrDirective); directives.register(NgShadowDomAttrDirective); From 902c2d59f77a3e900452fc62c466edbfaafba55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20D=C3=B6hring?= Date: Fri, 14 Jun 2013 13:36:01 +0300 Subject: [PATCH 2/5] Update ng_repeat.dart check for null --- lib/directives/ng_repeat.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/directives/ng_repeat.dart b/lib/directives/ng_repeat.dart index 9c7d6ff70..c1eaac795 100644 --- a/lib/directives/ng_repeat.dart +++ b/lib/directives/ng_repeat.dart @@ -27,7 +27,7 @@ class NgRepeatAttrDirective { var lastListLen = 0; // should be watchprops scope.$watch(listExpr, (List value, _, __) { - if (value.length == lastListLen) { return; } + if (value == null || value.length == lastListLen) { return; } lastListLen = value.length; // List changed! Erase everything. From 802fb4c9fc75d95083779671f044bf008916a549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20D=C3=B6hring?= Date: Fri, 14 Jun 2013 12:43:52 +0200 Subject: [PATCH 3/5] Update _specs.dart Dart Editor marks two exports as error. --- test/_specs.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/_specs.dart b/test/_specs.dart index c6320342d..47e71bb82 100644 --- a/test/_specs.dart +++ b/test/_specs.dart @@ -13,8 +13,6 @@ import 'package:unittest/mock.dart'; export 'package:unittest/unittest.dart'; export 'package:angular/debug.dart'; export 'package:angular/angular.dart'; -export 'dart:html'; -export 'jasmine_syntax.dart'; export 'package:di/di.dart'; export 'package:unittest/mock.dart'; From 2d99a313e2d16f98103df060b2551d6594922aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20D=C3=B6hring?= Date: Fri, 14 Jun 2013 13:47:55 +0300 Subject: [PATCH 4/5] Update _specs.dart remove is an override of List and requires one parameter --- test/_specs.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/_specs.dart b/test/_specs.dart index 47e71bb82..25250e56e 100644 --- a/test/_specs.dart +++ b/test/_specs.dart @@ -130,7 +130,7 @@ class JQuery implements List { contents() => fold(new JQuery(), (jq, node) => jq..addAll(node.nodes)); toString() => fold('', (html, node) => '$html${_toHtml(node, true)}'); eq(num childIndex) => $(this[childIndex]); - remove() => forEach((n) => n.remove()); + remove(Object value) => forEach((n) => n.remove()); attr([String name]) => accessor((n) => n.attributes[name], (n, v) => n.attributes[name] = v); } From 1902e9dc647ddf118e9f3e5f69df6485893fb673 Mon Sep 17 00:00:00 2001 From: Nils Doehring Date: Fri, 14 Jun 2013 14:20:39 +0200 Subject: [PATCH 5/5] fixed some imports/exports in /test. all tests passing with karma. --- test/_specs_spec.dart | 1 + test/block_spec.dart | 2 ++ test/compiler_spec.dart | 1 + test/controller_spec.dart | 1 + test/directive_spec.dart | 1 + test/directives/ng_bind_spec.dart | 2 ++ test/directives/ng_mustache_spec.dart | 1 + test/interpolate_spec.dart | 1 + test/mirrors_spec.dart | 1 + test/node_cursor_spec.dart | 2 ++ test/parser_spec.dart | 1 + test/scope_spec.dart | 1 + test/selector_spec.dart | 2 ++ test/template_spec.dart | 2 ++ 14 files changed, 19 insertions(+) diff --git a/test/_specs_spec.dart b/test/_specs_spec.dart index 6dd7833e9..26870dd74 100644 --- a/test/_specs_spec.dart +++ b/test/_specs_spec.dart @@ -1,4 +1,5 @@ import "_specs.dart"; +import 'jasmine_syntax.dart'; main() { describe('renderedText', () { diff --git a/test/block_spec.dart b/test/block_spec.dart index fcf3f51fa..90ce75d30 100644 --- a/test/block_spec.dart +++ b/test/block_spec.dart @@ -1,3 +1,5 @@ +import 'dart:html'; +import 'jasmine_syntax.dart'; import "_specs.dart"; class LoggerBlockDirective { diff --git a/test/compiler_spec.dart b/test/compiler_spec.dart index 57f7513f0..486aa875c 100644 --- a/test/compiler_spec.dart +++ b/test/compiler_spec.dart @@ -1,3 +1,4 @@ +import 'jasmine_syntax.dart'; import "_specs.dart"; import "dart:mirrors"; diff --git a/test/controller_spec.dart b/test/controller_spec.dart index e7acd1df2..cd6e64b54 100644 --- a/test/controller_spec.dart +++ b/test/controller_spec.dart @@ -1,6 +1,7 @@ import "_specs.dart"; import "_log.dart"; import "dart:mirrors"; +import 'jasmine_syntax.dart'; diff --git a/test/directive_spec.dart b/test/directive_spec.dart index 49904dd86..f5a25aaca 100644 --- a/test/directive_spec.dart +++ b/test/directive_spec.dart @@ -1,4 +1,5 @@ import "_specs.dart"; +import 'jasmine_syntax.dart'; // Types must be declared on the top level. Ugh. class SomeDirective { } diff --git a/test/directives/ng_bind_spec.dart b/test/directives/ng_bind_spec.dart index 18095b347..75ff9cb5b 100644 --- a/test/directives/ng_bind_spec.dart +++ b/test/directives/ng_bind_spec.dart @@ -1,4 +1,6 @@ import "../_specs.dart"; +import '../jasmine_syntax.dart'; +import "dart:html"; main() { // NOTE(deboer): beforeEach and nested describes don't play nicely. Repeat. diff --git a/test/directives/ng_mustache_spec.dart b/test/directives/ng_mustache_spec.dart index 5912233de..873a5b2b1 100644 --- a/test/directives/ng_mustache_spec.dart +++ b/test/directives/ng_mustache_spec.dart @@ -1,4 +1,5 @@ import "../_specs.dart"; +import '../jasmine_syntax.dart'; main() { describe('ng-mustache', () { diff --git a/test/interpolate_spec.dart b/test/interpolate_spec.dart index ecd5cac3f..3c1e28568 100644 --- a/test/interpolate_spec.dart +++ b/test/interpolate_spec.dart @@ -1,4 +1,5 @@ import "_specs.dart"; +import 'jasmine_syntax.dart'; main() { describe('\$interpolate', () { diff --git a/test/mirrors_spec.dart b/test/mirrors_spec.dart index e54c83ba0..6bfbbcf06 100644 --- a/test/mirrors_spec.dart +++ b/test/mirrors_spec.dart @@ -1,4 +1,5 @@ import "_specs.dart"; +import 'jasmine_syntax.dart'; class NoStatic { } class Static { diff --git a/test/node_cursor_spec.dart b/test/node_cursor_spec.dart index 4dfb35edd..06400763a 100644 --- a/test/node_cursor_spec.dart +++ b/test/node_cursor_spec.dart @@ -1,4 +1,6 @@ import '_specs.dart'; +import 'jasmine_syntax.dart'; +import 'dart:html'; $(html) { var body = new BodyElement(); diff --git a/test/parser_spec.dart b/test/parser_spec.dart index 18a5c9945..86a322dac 100644 --- a/test/parser_spec.dart +++ b/test/parser_spec.dart @@ -1,4 +1,5 @@ import '_specs.dart'; +import 'jasmine_syntax.dart'; class LexerExpect extends Expect { LexerExpect(actual) : super(actual); diff --git a/test/scope_spec.dart b/test/scope_spec.dart index 2de58e0d8..d3e5003ac 100644 --- a/test/scope_spec.dart +++ b/test/scope_spec.dart @@ -1,4 +1,5 @@ import "_specs.dart"; +import 'jasmine_syntax.dart'; main() { describe(r'Scope', () { diff --git a/test/selector_spec.dart b/test/selector_spec.dart index 37f0ce73e..376a1e423 100644 --- a/test/selector_spec.dart +++ b/test/selector_spec.dart @@ -1,4 +1,6 @@ import "_specs.dart"; +import 'jasmine_syntax.dart'; +import "dart:html"; main() { describe('Selector', () { diff --git a/test/template_spec.dart b/test/template_spec.dart index feb2e1cdd..adfe0445e 100644 --- a/test/template_spec.dart +++ b/test/template_spec.dart @@ -1,5 +1,7 @@ import "_specs.dart"; +import "dart:html"; import "_log.dart"; +import 'jasmine_syntax.dart'; class LogAttrDirective { static var $priority = 0;