From 9aad63643412fc29b289e5468a2aeb6f5841c6c2 Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 27 Feb 2014 13:07:41 +0100 Subject: [PATCH] doc(selector): add the ":contains()" pseudo-selector see dartbug.com/16422 --- lib/core/directive.dart | 1 + lib/core_dom/selector.dart | 1 + test/core_dom/selector_spec.dart | 34 ++++++++++++++++---------------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/core/directive.dart b/lib/core/directive.dart index 63fd69a0f..237c7f6bc 100644 --- a/lib/core/directive.dart +++ b/lib/core/directive.dart @@ -9,6 +9,7 @@ abstract class NgAnnotation { * * `.class` limit to an element with a given class. * * `[attribute]` limit to an element with a given attribute name. * * `[attribute=value]` limit to an element with a given attribute and value. + * * `:contains(/abc/)` limit to an element which contains the given text. * * * Example: `input[type=checkbox][ng-model]` diff --git a/lib/core_dom/selector.dart b/lib/core_dom/selector.dart index 2492d0608..ff0404a7e 100644 --- a/lib/core_dom/selector.dart +++ b/lib/core_dom/selector.dart @@ -22,6 +22,7 @@ part of angular.core.dom; * [attribute] * [attribute=value] * element[attribute1][attribute2=value] + * :contains(/abc/) * * * diff --git a/test/core_dom/selector_spec.dart b/test/core_dom/selector_spec.dart index da45baa83..332708582 100644 --- a/test/core_dom/selector_spec.dart +++ b/test/core_dom/selector_spec.dart @@ -44,23 +44,23 @@ main() { beforeEach(() => log = []); beforeEach(module((Module module) { module - ..type(_BElement) - ..type(_BClass) - ..type(_DirectiveAttr) - ..type(_WildcardDirectiveAttr) - ..type(_DirectiveFooAttr) - ..type(_BElementDirectiveAttr) - ..type(_DirectiveValueAttr) - ..type(_BElementDirectiveValue) - ..type(_ContainsAbc) - ..type(_AttributeContainsXyz) - ..type(_Component) - ..type(_Attribute) - ..type(_Structural) - ..type(_IgnoreChildren) - ..type(_TwoDirectives) - ..type(_OneOfTwoDirectives) - ..type(_TwoOfTwoDirectives); + ..type(_BElement) + ..type(_BClass) + ..type(_DirectiveAttr) + ..type(_WildcardDirectiveAttr) + ..type(_DirectiveFooAttr) + ..type(_BElementDirectiveAttr) + ..type(_DirectiveValueAttr) + ..type(_BElementDirectiveValue) + ..type(_ContainsAbc) + ..type(_AttributeContainsXyz) + ..type(_Component) + ..type(_Attribute) + ..type(_Structural) + ..type(_IgnoreChildren) + ..type(_TwoDirectives) + ..type(_OneOfTwoDirectives) + ..type(_TwoOfTwoDirectives); })); beforeEach(inject((DirectiveMap directives) { selector = directiveSelectorFactory(directives);