Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: third_party/pkg/angular/test/core_dom/block_spec.dart

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/test/core_dom/block_spec.dart
===================================================================
--- third_party/pkg/angular/test/core_dom/block_spec.dart (revision 33054)
+++ third_party/pkg/angular/test/core_dom/block_spec.dart (working copy)
@@ -2,12 +2,6 @@
import '../_specs.dart';
-class Log {
- List<String> log = <String>[];
-
- add(String msg) => log.add(msg);
-}
-
@NgDirective(children: NgAnnotation.TRANSCLUDE_CHILDREN, selector: 'foo')
class LoggerBlockDirective {
LoggerBlockDirective(BlockHole hole, BlockFactory blockFactory,
@@ -22,43 +16,24 @@
}
}
-@NgDirective(selector: 'dir-a')
-class ADirective {
- ADirective(Log log) {
- log.add('ADirective');
+class ReplaceBlockDirective {
+ ReplaceBlockDirective(BlockHole hole, BoundBlockFactory boundBlockFactory, Node node, Scope scope) {
+ var block = boundBlockFactory(scope);
+ block.insertAfter(hole);
+ node.remove();
}
}
-@NgDirective(selector: 'dir-b')
-class BDirective {
- BDirective(Log log) {
- log.add('BDirective');
+class ShadowBlockDirective {
+ ShadowBlockDirective(BlockHole hole, BoundBlockFactory boundBlockFactory, Element element, Scope scope) {
+ var block = boundBlockFactory(scope);
+ var shadowRoot = element.createShadowRoot();
+ for (var i = 0, ii = block.elements.length; i < ii; i++) {
+ shadowRoot.append(block.elements[i]);
+ }
}
}
-@NgFilter(name:'filterA')
-class AFilter {
- Log log;
-
- AFilter(this.log) {
- log.add('AFilter');
- }
-
- call(value) => value;
-}
-
-@NgFilter(name:'filterB')
-class BFilter {
- Log log;
-
- BFilter(this.log) {
- log.add('BFilter');
- }
-
- call(value) => value;
-}
-
-
main() {
describe('Block', () {
var anchor;
@@ -226,44 +201,6 @@
});
});
- describe('deferred', () {
-
- it('should load directives/filters from the child injector', () {
- Module rootModule = new Module()
- ..type(Probe)
- ..type(Log)
- ..type(AFilter)
- ..type(ADirective);
-
- Injector rootInjector =
- new DynamicInjector(modules: [new AngularModule(), rootModule]);
- Log log = rootInjector.get(Log);
- Scope rootScope = rootInjector.get(Scope);
-
- Compiler compiler = rootInjector.get(Compiler);
- DirectiveMap directives = rootInjector.get(DirectiveMap);
- compiler(es('<dir-a>{{\'a\' | filterA}}</dir-a><dir-b></dir-b>'), directives)(rootInjector);
- rootScope.apply();
-
- expect(log.log, equals(['ADirective', 'AFilter']));
-
-
- Module childModule = new Module()
- ..type(BFilter)
- ..type(BDirective);
-
- var childInjector = forceNewDirectivesAndFilters(rootInjector, [childModule]);
-
- DirectiveMap newDirectives = childInjector.get(DirectiveMap);
- compiler(es('<dir-a probe="dirA"></dir-a>{{\'a\' | filterA}}'
- '<dir-b probe="dirB"></dir-b>{{\'b\' | filterB}}'), newDirectives)(childInjector);
- rootScope.apply();
-
- expect(log.log, equals(['ADirective', 'AFilter', 'ADirective', 'BDirective', 'BFilter']));
- });
-
- });
-
//TODO: tests for attach/detach
//TODO: animation/transitions
//TODO: tests for re-usability of blocks
« no previous file with comments | « third_party/pkg/angular/test/core/zone_spec.dart ('k') | third_party/pkg/angular/test/core_dom/compiler_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698