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

Fixes for errors in the demo #5

Closed
wants to merge 5 commits into from
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
6 changes: 3 additions & 3 deletions demo/web/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<dom.Node> topElt = dom.query('[ng-app]').nodes.toList();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/directives/ng_repeat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions test/_specs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -132,7 +130,7 @@ class JQuery implements List<Node> {
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);
}

Expand Down
1 change: 1 addition & 0 deletions test/_specs_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "_specs.dart";
import 'jasmine_syntax.dart';

main() {
describe('renderedText', () {
Expand Down
2 changes: 2 additions & 0 deletions test/block_spec.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:html';
import 'jasmine_syntax.dart';
import "_specs.dart";

class LoggerBlockDirective {
Expand Down
1 change: 1 addition & 0 deletions test/compiler_spec.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'jasmine_syntax.dart';
import "_specs.dart";
import "dart:mirrors";

Expand Down
1 change: 1 addition & 0 deletions test/controller_spec.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "_specs.dart";
import "_log.dart";
import "dart:mirrors";
import 'jasmine_syntax.dart';



Expand Down
1 change: 1 addition & 0 deletions test/directive_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "_specs.dart";
import 'jasmine_syntax.dart';

// Types must be declared on the top level. Ugh.
class SomeDirective { }
Expand Down
2 changes: 2 additions & 0 deletions test/directives/ng_bind_spec.dart
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 1 addition & 0 deletions test/directives/ng_mustache_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "../_specs.dart";
import '../jasmine_syntax.dart';

main() {
describe('ng-mustache', () {
Expand Down
1 change: 1 addition & 0 deletions test/interpolate_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "_specs.dart";
import 'jasmine_syntax.dart';

main() {
describe('\$interpolate', () {
Expand Down
1 change: 1 addition & 0 deletions test/mirrors_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "_specs.dart";
import 'jasmine_syntax.dart';

class NoStatic { }
class Static {
Expand Down
2 changes: 2 additions & 0 deletions test/node_cursor_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import '_specs.dart';
import 'jasmine_syntax.dart';
import 'dart:html';

$(html) {
var body = new BodyElement();
Expand Down
1 change: 1 addition & 0 deletions test/parser_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import '_specs.dart';
import 'jasmine_syntax.dart';

class LexerExpect extends Expect {
LexerExpect(actual) : super(actual);
Expand Down
1 change: 1 addition & 0 deletions test/scope_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "_specs.dart";
import 'jasmine_syntax.dart';

main() {
describe(r'Scope', () {
Expand Down
2 changes: 2 additions & 0 deletions test/selector_spec.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import "_specs.dart";
import 'jasmine_syntax.dart';
import "dart:html";

main() {
describe('Selector', () {
Expand Down
2 changes: 2 additions & 0 deletions test/template_spec.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import "_specs.dart";
import "dart:html";
import "_log.dart";
import 'jasmine_syntax.dart';

class LogAttrDirective {
static var $priority = 0;
Expand Down