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

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

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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/filter/json.dart ('k') | third_party/pkg/angular/lib/filter/lowercase.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/lib/filter/limit_to.dart
diff --git a/third_party/pkg/angular/lib/filter/limit_to.dart b/third_party/pkg/angular/lib/filter/limit_to.dart
deleted file mode 100644
index 1237a8a5b3814e0913113c35f77305367780bc41..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/lib/filter/limit_to.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-part of angular.filter;
-
-/**
- * Creates a new List or String containing only a prefix/suffix of the
- * elements as specified by the `limit` parameter.
- *
- * When operating on a List, the returned list is always a copy even when all
- * the elements are being returned.
- *
- * When the `limit` expression evaluates to a positive integer, `limit` items
- * from the beginning of the List/String are returned. When `limit` evaluates
- * to a negative integer, `|limit|` items from the end of the List/String are
- * returned. If `|limit|` is larger than the size of the List/String, then the
- * entire List/String is returned. In the case of a List, a copy of the list is
- * returned.
- *
- * If the `limit` expression evaluates to a null or non-integer, then an empty
- * list is returned. If the input is a null List/String, a null is returned.
- *
- * Example:
- *
- * - `{{ 'abcdefghij' | limitTo: 4 }}` → `'abcd'`
- * - `{{ 'abcdefghij' | limitTo: -4 }}` → `'ghij'`
- * - `{{ 'abcdefghij' | limitTo: -100 }}` → `'abcdefghij'`
- *
- * <br>
- *
- * This [ng-repeat] directive:
- *
- * <li ng-repeat="i in 'abcdefghij' | limitTo:-2">{{i}}</li>
- *
- * results in
- *
- * <li>i</li>
- * <li>j</li>
- */
-@NgFilter(name:'limitTo')
-class LimitToFilter {
- Injector _injector;
-
- LimitToFilter(this._injector);
-
- dynamic call(dynamic items, [int limit]) {
- if (items == null) return null;
- if (limit == null) return const[];
- if (items is! List && items is! String) return items;
- int i = 0, j = items.length;
- if (limit > -1) {
- j = (limit > j) ? j : limit;
- } else {
- i = j + limit;
- if (i < 0) i = 0;
- }
- return items is String ?
- (items as String).substring(i, j) :
- (items as List).getRange(i, j).toList(growable: false);
- }
-}
« no previous file with comments | « third_party/pkg/angular/lib/filter/json.dart ('k') | third_party/pkg/angular/lib/filter/lowercase.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698