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

Unified Diff: third_party/pkg/angular/lib/formatter/filter.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
« no previous file with comments | « third_party/pkg/angular/lib/formatter/date.dart ('k') | third_party/pkg/angular/lib/formatter/json.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/lib/formatter/filter.dart
diff --git a/third_party/pkg/angular/lib/filter/filter.dart b/third_party/pkg/angular/lib/formatter/filter.dart
similarity index 93%
rename from third_party/pkg/angular/lib/filter/filter.dart
rename to third_party/pkg/angular/lib/formatter/filter.dart
index 1203466dcfa79b20c6a1784bf1b6164e137a3cd4..316771537088d38a1d43c2bfc413b55493cac598 100644
--- a/third_party/pkg/angular/lib/filter/filter.dart
+++ b/third_party/pkg/angular/lib/formatter/filter.dart
@@ -1,15 +1,15 @@
-part of angular.filter;
+part of angular.formatter_internal;
// Too bad you can't stick typedef's inside a class.
-typedef bool Predicate(e);
-typedef bool Equals(a, b);
+typedef bool _Predicate(e);
+typedef bool _Equals(a, b);
/**
* Selects a subset of items from the provided [List] and returns it as a new
* [List].
*
* In addition to the input list (implicit in an Angular expression syntax),
- * this filter takes 1 required and 1 optional parameter.  They are:
+ * this formatter takes 1 required and 1 optional parameter.  They are:
*
* - `expression` (required) - one of [Map], [Function], [String], [bool], [num]
* - `comparator` (optional)
@@ -32,7 +32,7 @@ typedef bool Equals(a, b);
* That's equivalent to the simple substring match with a `String` as
* described above.
*
- * - [Function]:  This allows you to supply a custom function to filter the
+ * - [Function]:  This allows you to supply a custom function to formatter the
* List.  The function is called for each element of the List.  The returned
* List contains exactly those elements for which this function returned
* `true`.
@@ -62,7 +62,7 @@ typedef bool Equals(a, b);
* // main.dart
* import 'package:angular/angular.dart';
*
- * @NgDirective(selector: '[toy-data]')
+ * @Decorator(selector: '[toy-data]')
* class ToyData {
* ToyData(Scope scope) {
* scope.friends = [{'name':'John', 'phone':'555-1276'},
@@ -109,11 +109,11 @@ typedef bool Equals(a, b);
* </body>
* </html>
*/
-@NgFilter(name: 'filter')
-class FilterFilter {
+@Formatter(name: 'filter')
+class Filter implements Function {
Parser _parser;
- Equals _comparator;
- Equals _stringComparator;
+ _Equals _comparator;
+ _Equals _stringComparator;
static _nop(e) => e;
static _ensureBool(val) => (val is bool && val);
@@ -123,7 +123,7 @@ class FilterFilter {
(a is String && b is String && a == b) ||
(a is num && b is num && a.isNaN && b.isNaN);
- FilterFilter(this._parser);
+ Filter(this._parser);
void _configureComparator(var comparatorExpression) {
if (comparatorExpression == null || comparatorExpression == false) {
@@ -132,7 +132,7 @@ class FilterFilter {
} else if (comparatorExpression == true) {
_stringComparator = _identical;
_comparator = _defaultComparator;
- } else if (comparatorExpression is Equals) {
+ } else if (comparatorExpression is _Equals) {
_comparator = (a, b) => _ensureBool(comparatorExpression(a, b));
} else {
_comparator = null;
@@ -185,8 +185,8 @@ class FilterFilter {
}
}
- Predicate _toPredicate(var expression) {
- if (expression is Predicate) {
+ _Predicate _toPredicate(var expression) {
+ if (expression is _Predicate) {
return (item) => _ensureBool(expression(item));
} else if (_comparator == null) {
return (item) => false; // Bad comparator → no items for you!
« no previous file with comments | « third_party/pkg/angular/lib/formatter/date.dart ('k') | third_party/pkg/angular/lib/formatter/json.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698