| Index: third_party/pkg/angular/lib/tools/selector.dart
|
| diff --git a/third_party/pkg/angular/lib/tools/selector.dart b/third_party/pkg/angular/lib/tools/selector.dart
|
| index c3ad253a60b9a9b684a971fd3a9bc7188056d096..1db5a5bab74d88b6b37847769714123c5cc23375 100644
|
| --- a/third_party/pkg/angular/lib/tools/selector.dart
|
| +++ b/third_party/pkg/angular/lib/tools/selector.dart
|
| @@ -11,7 +11,7 @@ class ContainsSelector {
|
| }
|
| }
|
|
|
| -RegExp _SELECTOR_REGEXP = new RegExp(r'^(?:([\w\-]+)|(?:\.([\w\-]+))|(?:\[([\w\-]+)(?:=([^\]]*))?\]))');
|
| +RegExp _SELECTOR_REGEXP = new RegExp(r'^(?:([\w\-]+)|(?:\.([\w\-]+))|(?:\[([\w\-\*]+)(?:=([^\]]*))?\]))');
|
| RegExp _COMMENT_COMPONENT_REGEXP = new RegExp(r'^\[([\w\-]+)(?:\=(.*))?\]$');
|
| RegExp _CONTAINS_REGEXP = new RegExp(r'^:contains\(\/(.+)\/\)$'); //
|
| RegExp _ATTR_CONTAINS_REGEXP = new RegExp(r'^\[\*=\/(.+)\/\]$'); //
|
| @@ -101,9 +101,10 @@ bool matchesNode(Node node, String selector) {
|
| stillGood = false;
|
| }
|
| } else if (part.attrName != null) {
|
| - if (part.attrValue == '' ?
|
| - node.attributes[part.attrName] == null :
|
| - node.attributes[part.attrName] != part.attrValue) {
|
| + String matchingKey = _matchingKey(node.attributes.keys, part.attrName);
|
| + if (matchingKey == null || part.attrValue == '' ?
|
| + node.attributes[matchingKey] == null :
|
| + node.attributes[matchingKey] != part.attrValue) {
|
| stillGood = false;
|
| }
|
| }
|
| @@ -122,3 +123,8 @@ bool matchesNode(Node node, String selector) {
|
| }
|
| return false;
|
| }
|
| +
|
| +String _matchingKey(Iterable keys, String attrName) =>
|
| + keys.firstWhere(
|
| + (key) => new RegExp('^${attrName.replaceAll('*', r'[\w\-]+')}\$').hasMatch(key.toString()),
|
| + orElse: () => null);
|
|
|