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

Side by Side Diff: third_party/pkg/angular/lib/core/filter.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 part of angular.core;
2
3 /**
4 * Use @[NgFilter] annotation to register a new filter. A filter is a class
5 * with a [call] method (a callable function).
6 *
7 * Usage:
8 *
9 * // Declaration
10 * @NgFilter(name:'myFilter')
11 * class MyFilter {
12 * call(valueToFilter, optArg1, optArg2) {
13 * return ...;
14 * }
15 * }
16 *
17 *
18 * // Registration
19 * var module = ...;
20 * module.type(MyFilter);
21 *
22 *
23 * <!-- Usage -->
24 * <span>{{something | myFilter:arg1:arg2}}</span>
25 */
26 class NgFilter {
27 final String name;
28
29 const NgFilter({this.name});
30
31 int get hashCode => name.hashCode;
32 bool operator==(other) => this.name == other.name;
33
34 toString() => 'NgFilter: $name';
35 }
36
37 /**
38 * Registry of filters at runtime.
39 */
40 @NgInjectableService()
41 class FilterMap extends AnnotationMap<NgFilter> {
42 Injector _injector;
43 FilterMap(Injector injector, MetadataExtractor extractMetadata) :
44 this._injector = injector,
45 super(injector, extractMetadata);
46
47 call(String name) {
48 var filter = new NgFilter(name:name);
49 var filterType = this[filter];
50 return _injector.get(filterType);
51 }
52 }
53
OLDNEW
« no previous file with comments | « third_party/pkg/angular/lib/core/exception_handler.dart ('k') | third_party/pkg/angular/lib/core/interpolate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698