chore: remove obsolete files (#10240)

This commit is contained in:
Victor Berchet
2016-07-22 16:18:31 -07:00
committed by GitHub
parent e34eb4520f
commit b652a7fc9f
166 changed files with 1 additions and 12836 deletions
-1583
View File
File diff suppressed because it is too large Load Diff
-6
View File
@@ -1,6 +0,0 @@
Angular2
=========
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo. This is the repository for the upcoming 2.0 version. If you're looking for the current official version of Angular you should go to [angular/angular.js](https://github.com/angular/angular.js)
License: Apache MIT 2.0
-1
View File
@@ -1 +0,0 @@
export 'index.dart';
@@ -1,63 +0,0 @@
library angular2.directives.observable_list_iterable_diff;
import 'package:observe/observe.dart' show ObservableList;
import 'package:angular2/core.dart';
import 'package:angular2/src/core/change_detection/differs/default_iterable_differ.dart';
import 'dart:async';
class ObservableListDiff extends DefaultIterableDiffer {
ChangeDetectorRef _ref;
ObservableListDiff(this._ref);
bool _updated = true;
ObservableList _collection;
StreamSubscription _subscription;
onDestroy() {
if (this._subscription != null) {
this._subscription.cancel();
this._subscription = null;
this._collection = null;
}
}
DefaultIterableDiffer diff(ObservableList collection) {
if (collection is! ObservableList) {
throw "Cannot change the type of a collection";
}
// A new collection instance is passed in.
// - We need to set up a listener.
// - We need to diff collection.
if (!identical(_collection, collection)) {
_collection = collection;
if (_subscription != null) _subscription.cancel();
_subscription = collection.changes.listen((_) {
_updated = true;
_ref.markForCheck();
});
_updated = false;
return super.diff(collection);
// An update has been registered since the last change detection check.
// - We reset the flag.
// - We diff the collection.
} else if (_updated) {
_updated = false;
return super.diff(collection);
// No updates has been registered.
} else {
return null;
}
}
}
class ObservableListDiffFactory implements IterableDifferFactory {
const ObservableListDiffFactory();
bool supports(obj) => obj is ObservableList;
IterableDiffer create(ChangeDetectorRef cdRef, [Function trackByFn]) {
return new ObservableListDiff(cdRef);
}
}
@@ -1,20 +0,0 @@
library angular2.core.forms.normalize_validators;
import 'package:angular2/src/common/forms/directives/validators.dart' show Validator;
Function normalizeValidator(dynamic validator){
if (validator is Validator) {
return (c) => validator.validate(c);
} else {
return validator;
}
}
Function normalizeAsyncValidator(dynamic validator){
if (validator is Validator) {
return (c) => validator.validate(c);
} else {
return validator;
}
}
@@ -51,9 +51,6 @@ var defaultLocale: string = 'en-US';
*
* In javascript, only the components specified will be respected (not the ordering,
* punctuations, ...) and details of the formatting will be dependent on the locale.
* On the other hand in Dart version, you can also include quoted text as well as some extra
* date/time components such as quarter. For more information see:
* https://www.dartdocs.org/documentation/intl/0.13.0/intl/DateFormat-class.html
*
* `format` can also be one of the following predefined formats:
*
@@ -1,102 +0,0 @@
library angular2.test.directives.observable_list_iterable_diff_spec;
import 'package:angular2/testing_internal.dart';
import 'package:observe/observe.dart' show ObservableList;
import 'package:angular2/core.dart' show ChangeDetectorRef;
import 'package:angular2/common.dart' show ObservableListDiffFactory;
@proxy
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {}
main() {
describe('ObservableListDiff', () {
var factory, changeDetectorRef;
beforeEach(() {
factory = const ObservableListDiffFactory();
changeDetectorRef = new SpyChangeDetectorRef();
});
describe("supports", () {
it("should be true for ObservableList", () {
expect(factory.supports(new ObservableList())).toBe(true);
});
it("should be false otherwise", () {
expect(factory.supports([1, 2, 3])).toBe(false);
});
});
it("should return itself when called the first time", () {
final d = factory.create(changeDetectorRef);
final c = new ObservableList.from([1, 2]);
expect(d.diff(c)).toBe(d);
});
it("should return itself when no changes between the calls", () {
final d = factory.create(changeDetectorRef);
final c = new ObservableList.from([1, 2]);
d.diff(c);
expect(d.diff(c)).toBe(null);
});
it("should return the wrapped value once a change has been triggered",
fakeAsync(() {
final d = factory.create(changeDetectorRef);
final c = new ObservableList.from([1, 2]);
d.diff(c);
c.add(3);
// same value, because we have not detected the change yet
expect(d.diff(c)).toBe(null);
// now we detect the change
flushMicrotasks();
expect(d.diff(c)).toBe(d);
}));
it("should request a change detection check upon receiving a change",
fakeAsync(() {
final d = factory.create(changeDetectorRef);
final c = new ObservableList.from([1, 2]);
d.diff(c);
c.add(3);
flushMicrotasks();
expect(changeDetectorRef.spy("markForCheck")).toHaveBeenCalledOnce();
}));
it("should return the wrapped value after changing a collection", () {
final d = factory.create(changeDetectorRef);
final c1 = new ObservableList.from([1, 2]);
final c2 = new ObservableList.from([3, 4]);
expect(d.diff(c1)).toBe(d);
expect(d.diff(c2)).toBe(d);
});
it("should not unbsubscribe from the stream of chagnes after changing a collection",
() {
final d = factory.create(changeDetectorRef);
final c1 = new ObservableList.from([1, 2]);
expect(d.diff(c1)).toBe(d);
final c2 = new ObservableList.from([3, 4]);
expect(d.diff(c2)).toBe(d);
// pushing into the first collection has no effect, and we do not see the change
c1.add(3);
expect(d.diff(c2)).toBe(null);
});
});
}
-14
View File
@@ -1,14 +0,0 @@
library core.spies;
import 'package:angular2/common.dart';
import 'package:angular2/src/core/change_detection/change_detection.dart';
import 'package:angular2/testing_internal.dart';
@proxy
class SpyNgControl extends SpyObject implements NgControl {}
@proxy
class SpyValueAccessor extends SpyObject implements ControlValueAccessor {}
@proxy
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {}
@@ -1 +0,0 @@
export '../core/private_export.dart';
@@ -1 +0,0 @@
export './src/core/change_detection/constants.dart' show SelectorMatcher, CssSelector;
@@ -1,3 +0,0 @@
library angular2.core.util.asserions;
void assertArrayOfStrings(String identifier, Object value) {}
@@ -1,69 +0,0 @@
library angular2.src.services.url_resolver;
import 'package:angular2/src/core/di.dart' show Injectable, Inject, Provider;
import 'package:angular2/src/facade/lang.dart' show isPresent, StringWrapper;
import 'package:angular2/src/core/application_tokens.dart' show PACKAGE_ROOT_URL;
const _ASSET_SCHEME = 'asset:';
UrlResolver createUrlResolverWithoutPackagePrefix() {
return new UrlResolver.withUrlPrefix(null);
}
UrlResolver createOfflineCompileUrlResolver() {
return new UrlResolver.withUrlPrefix(_ASSET_SCHEME);
}
const DEFAULT_PACKAGE_URL_PROVIDER = const Provider(PACKAGE_ROOT_URL, useValue: "/packages");
@Injectable()
class UrlResolver {
/// This will be the location where 'package:' Urls will resolve. Default is
/// '/packages'
final String _packagePrefix;
UrlResolver([@Inject(PACKAGE_ROOT_URL) this._packagePrefix]);
/// Creates a UrlResolver that will resolve 'package:' Urls to a different
/// prefixed location.
const UrlResolver.withUrlPrefix(this._packagePrefix);
/**
* Resolves the `url` given the `baseUrl`:
* - when the `url` is null, the `baseUrl` is returned,
* - if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of
* `baseUrl` and `url`,
* - if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is
* returned as is (ignoring the `baseUrl`)
*
* @param {string} baseUrl
* @param {string} url
* @returns {string} the resolved URL
*/
String resolve(String baseUrl, String url) {
Uri uri = Uri.parse(url);
if (isPresent(baseUrl) && baseUrl.length > 0) {
Uri baseUri = Uri.parse(baseUrl);
uri = baseUri.resolveUri(uri);
}
var prefix = this._packagePrefix;
if (prefix != null && uri.scheme == 'package') {
if (prefix == _ASSET_SCHEME) {
var pathSegments = uri.pathSegments.toList()..insert(1, 'lib');
return new Uri(scheme: 'asset', pathSegments: pathSegments).toString();
} else {
prefix = StringWrapper.stripRight(prefix, '/');
var path = StringWrapper.stripLeft(uri.path, '/');
return '$prefix/$path';
}
} else {
return uri.toString();
}
}
}
String getUrlScheme(String url) {
return Uri.parse(url).scheme;
}
@@ -1,148 +0,0 @@
library angular2.test.core.compiler.directive_lifecycle_spec;
import 'package:angular2/testing_internal.dart';
import 'package:angular2/src/compiler/directive_lifecycle_reflector.dart';
import 'package:angular2/src/core/metadata/lifecycle_hooks.dart';
main() {
describe('Create DirectiveMetadata', () {
describe('lifecycle', () {
describe("ngOnChanges", () {
it("should be true when the directive has the ngOnChanges method", () {
expect(hasLifecycleHook(
LifecycleHooks.OnChanges, DirectiveImplementingOnChanges))
.toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(LifecycleHooks.OnChanges, DirectiveNoHooks))
.toBe(false);
});
});
describe("ngOnDestroy", () {
it("should be true when the directive has the ngOnDestroy method", () {
expect(hasLifecycleHook(
LifecycleHooks.OnDestroy, DirectiveImplementingOnDestroy))
.toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(LifecycleHooks.OnDestroy, DirectiveNoHooks))
.toBe(false);
});
});
describe("ngOnInit", () {
it("should be true when the directive has the ngOnInit method", () {
expect(hasLifecycleHook(
LifecycleHooks.OnInit, DirectiveImplementingOnInit)).toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(LifecycleHooks.OnInit, DirectiveNoHooks))
.toBe(false);
});
});
describe("ngDoCheck", () {
it("should be true when the directive has the ngDoCheck method", () {
expect(hasLifecycleHook(
LifecycleHooks.DoCheck, DirectiveImplementingOnCheck)).toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(LifecycleHooks.DoCheck, DirectiveNoHooks))
.toBe(false);
});
});
describe("ngAfterContentInit", () {
it("should be true when the directive has the ngAfterContentInit method",
() {
expect(hasLifecycleHook(LifecycleHooks.AfterContentInit,
DirectiveImplementingAfterContentInit)).toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(
LifecycleHooks.AfterContentInit, DirectiveNoHooks)).toBe(false);
});
});
describe("ngAfterContentChecked", () {
it("should be true when the directive has the ngAfterContentChecked method",
() {
expect(hasLifecycleHook(LifecycleHooks.AfterContentChecked,
DirectiveImplementingAfterContentChecked)).toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(
LifecycleHooks.AfterContentChecked, DirectiveNoHooks))
.toBe(false);
});
});
describe("ngAfterViewInit", () {
it("should be true when the directive has the ngAfterViewInit method",
() {
expect(hasLifecycleHook(LifecycleHooks.AfterViewInit,
DirectiveImplementingAfterViewInit)).toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(
LifecycleHooks.AfterViewInit, DirectiveNoHooks)).toBe(false);
});
});
describe("ngAfterViewChecked", () {
it("should be true when the directive has the ngAfterViewChecked method",
() {
expect(hasLifecycleHook(LifecycleHooks.AfterViewChecked,
DirectiveImplementingAfterViewChecked)).toBe(true);
});
it("should be false otherwise", () {
expect(hasLifecycleHook(
LifecycleHooks.AfterViewChecked, DirectiveNoHooks)).toBe(false);
});
});
});
});
}
class DirectiveNoHooks {}
class DirectiveImplementingOnChanges implements OnChanges {
ngOnChanges(_) {}
}
class DirectiveImplementingOnCheck implements DoCheck {
ngDoCheck() {}
}
class DirectiveImplementingOnInit implements OnInit {
ngOnInit() {}
}
class DirectiveImplementingOnDestroy implements OnDestroy {
ngOnDestroy() {}
}
class DirectiveImplementingAfterContentInit implements AfterContentInit {
ngAfterContentInit() {}
}
class DirectiveImplementingAfterContentChecked implements AfterContentChecked {
ngAfterContentChecked() {}
}
class DirectiveImplementingAfterViewInit implements AfterViewInit {
ngAfterViewInit() {}
}
class DirectiveImplementingAfterViewChecked implements AfterViewChecked {
ngAfterViewChecked() {}
}
@@ -1,9 +0,0 @@
library angular2.test.compiler.metadata_resolver_fixture;
import "package:angular2/core.dart" show Component;
// This component is not actually malformed; this fixture is here to
// make Dart not complain about a missing import for a test case that only
// matters in an JavaScript app.
@Component(template: "")
class MalformedStylesComponent {}
@@ -1,5 +0,0 @@
/**
* We don't know how to extract schema in dart, so do nothing.
*/
extractSchema(fn(List<String> descriptors)) {
}
@@ -1,7 +0,0 @@
library compiler.spies;
import 'package:angular2/src/compiler/xhr.dart';
import 'package:angular2/testing_internal.dart';
@proxy
class SpyXHR extends SpyObject implements XHR {}
-26
View File
@@ -1,26 +0,0 @@
library angular2.core;
export './src/core/angular_entrypoint.dart' show AngularEntrypoint;
export './src/core/metadata.dart';
export './src/core/util.dart';
export './src/core/di.dart' hide ForwardRefFn, resolveForwardRef, forwardRef;
export './src/facade/facade.dart';
export './src/core/application_ref.dart' show createPlatform, assertPlatform,
disposePlatform, getPlatform,
coreLoadAndBootstrap, coreBootstrap, PlatformRef, ApplicationRef;
export './src/core/application_tokens.dart' show APP_ID,
APP_INITIALIZER,
PACKAGE_ROOT_URL,
PLATFORM_INITIALIZER;
export './src/core/zone.dart';
export './src/core/render.dart';
export './src/core/linker.dart';
export './src/core/debug/debug_node.dart' show DebugElement,
DebugNode,
asNativeElements;
export './src/core/testability/testability.dart';
export './src/core/change_detection.dart';
export './src/core/platform_directives_and_pipes.dart';
export './src/core/platform_common_providers.dart';
export './src/core/application_common_providers.dart';
export './src/core/reflection/reflection.dart';
-17
View File
@@ -1,17 +0,0 @@
export './src/core/change_detection/constants.dart' show isDefaultChangeDetectionStrategy, CHANGE_DETECTION_STRATEGY_VALUES;
export './src/core/di/reflective_provider.dart' show constructDependencies;
export './src/core/metadata/lifecycle_hooks.dart' show LifecycleHooks, LIFECYCLE_HOOKS_VALUES;
export './src/core/reflection/reflector_reader.dart' show ReflectorReader;
export './src/core/linker/component_resolver.dart' show ReflectorComponentResolver;
export './src/core/linker/element.dart' show AppElement;
export './src/core/linker/view.dart' show AppView;
export './src/core/linker/view_type.dart' show ViewType;
export './src/core/linker/view_utils.dart' show MAX_INTERPOLATION_VALUES, checkBinding, flattenNestedViewRenderNodes, interpolate, ViewUtils;
export './src/core/metadata/view.dart' show VIEW_ENCAPSULATION_VALUES;
export './src/core/linker/debug_context.dart' show DebugContext, StaticNodeDebugInfo;
export './src/core/change_detection/change_detection_util.dart' show devModeEqual, uninitialized, ValueUnwrapper;
export './src/core/render/api.dart' show RenderDebugInfo;
export './src/core/linker/template_ref.dart' show TemplateRef_;
export './src/core/profile/wtf_init.dart' show wtfInit;
export './src/core/reflection/reflection_capabilities.dart' show ReflectionCapabilities;
export './src/util/decorators' show makeDecorator;
@@ -1,33 +0,0 @@
/**
* To create a Pipe, you must implement this interface.
*
* Angular invokes the `transform` method with the value of a binding
* as the first argument, and any parameters as the second argument in list form.
*
* ## Syntax
*
* `value | pipeName[:arg0[:arg1...]]`
*
* ### Example ([live demo](http://plnkr.co/edit/f5oyIked9M2cKzvZNKHV?p=preview))
*
* The `RepeatPipe` below repeats the value as many times as indicated by the first argument:
*
* ```
* import {Pipe, PipeTransform} from 'angular2/core';
*
* @Pipe({name: 'repeat'})
* export class RepeatPipe implements PipeTransform {
* transform(value: any, times: number) {
* return value.repeat(times);
* }
* }
* ```
*
* Invoking `{{ 'ok' | repeat:3 }}` in a template produces `okokok`.
*
*/
abstract class PipeTransform {
// Note: Dart does not support varargs,
// so we can't type the `transform` method...
// dynamic transform(dynamic value, List<dynamic> ...args): any;
}
@@ -1,52 +0,0 @@
library angular2.di.decorators;
import 'metadata.dart';
export 'metadata.dart';
/**
* {@link InjectMetadata}.
* @stable
*/
class Inject extends InjectMetadata {
const Inject(dynamic token) : super(token);
}
/**
* {@link OptionalMetadata}.
* @stable
*/
class Optional extends OptionalMetadata {
const Optional() : super();
}
/**
* {@link InjectableMetadata}.
* @stable
*/
class Injectable extends InjectableMetadata {
const Injectable() : super();
}
/**
* {@link SelfMetadata}.
* @stable
*/
class Self extends SelfMetadata {
const Self() : super();
}
/**
* {@link HostMetadata}.
* @stable
*/
class Host extends HostMetadata {
const Host() : super();
}
/**
* {@link SkipSelfMetadata}.
* @stable
*/
class SkipSelf extends SkipSelfMetadata {
const SkipSelf() : super();
}
@@ -1,15 +0,0 @@
library angular2.di.forward_ref;
typedef dynamic ForwardRefFn();
/**
* Dart does not have the forward ref problem, so this function is a noop.
*/
forwardRef(ForwardRefFn forwardRefFn) => forwardRefFn();
/**
* Lazily retrieve the reference value.
*
* See: {@link forwardRef}
*/
resolveForwardRef(type) => type;
@@ -1,20 +0,0 @@
import './provider.dart' show Provider;
bool isProviderLiteral(dynamic obj) {
if (obj is Map) {
Map map = obj as Map;
return map.containsKey('provide');
} else {
return false;
}
}
Provider createProvider(dynamic obj) {
Map map = obj as Map;
return new Provider(map['provide'], useClass: map['useClass'],
useValue: map['useValue'],
useExisting: map['useExisting'],
useFactory: map['useFactory'],
deps: map['deps'],
multi: map['multi']);
}
@@ -1,44 +0,0 @@
library angular2.src.core.compiler.query_list;
import 'dart:collection';
import 'package:angular2/src/facade/collection.dart';
import 'package:angular2/src/facade/async.dart';
/**
* See query_list.ts
*/
class QueryList<T> extends Object with IterableMixin<T> {
bool _dirty = true;
List<T> _results = [];
EventEmitter _emitter = new EventEmitter();
Iterator<T> get iterator => _results.iterator;
Stream<Iterable<T>> get changes => _emitter;
int get length => _results.length;
T get first => _results.length > 0 ? _results.first : null;
T get last => _results.length > 0 ? _results.last : null;
String toString() {
return _results.toString();
}
/** @internal */
void reset(List<T> newList) {
_results = ListWrapper.flatten(newList);
_dirty = false;
}
/** @internal */
void notifyOnChanges() {
_emitter.add(this);
}
/** @internal **/
bool get dirty => _dirty;
/** @internal **/
void setDirty() {
_dirty = true;
}
}
-228
View File
@@ -1,228 +0,0 @@
library angular2.src.core.metadata;
import 'package:angular2/src/facade/collection.dart' show List;
import 'package:angular2/src/core/change_detection/change_detection.dart';
import './metadata/di.dart';
import './metadata/directives.dart';
import './metadata/view.dart';
import './metadata/animations.dart' show AnimationEntryMetadata;
export './metadata/di.dart';
export './metadata/directives.dart';
export './metadata/view.dart' hide VIEW_ENCAPSULATION_VALUES;
export './metadata/lifecycle_hooks.dart' show
AfterContentInit,
AfterContentChecked,
AfterViewInit,
AfterViewChecked,
OnChanges,
OnDestroy,
OnInit,
DoCheck;
/**
* See: [DirectiveMetadata] for docs.
* @stable
*/
class Directive extends DirectiveMetadata {
const Directive(
{String selector,
List<String> inputs,
List<String> outputs,
@Deprecated('Use `inputs` or `@Input` instead')
List<String> properties,
@Deprecated('Use `outputs` or `@Output` instead')
List<String> events,
Map<String, String> host,
List providers,
String exportAs,
Map<String, dynamic> queries})
: super(
selector: selector,
inputs: inputs,
outputs: outputs,
properties: properties,
events: events,
host: host,
providers: providers,
exportAs: exportAs,
queries: queries);
}
/**
* See: [ComponentMetadata] for docs.
* @stable
*/
class Component extends ComponentMetadata {
const Component(
{String selector,
List<String> inputs,
List<String> outputs,
@Deprecated('Use `inputs` or `@Input` instead')
List<String> properties,
@Deprecated('Use `outputs` or `@Output` instead')
List<String> events,
Map<String, String> host,
List providers,
String exportAs,
String moduleId,
Map<String, dynamic> queries,
List viewProviders,
ChangeDetectionStrategy changeDetection,
String templateUrl,
String template,
dynamic directives,
dynamic pipes,
ViewEncapsulation encapsulation,
List<String> styles,
List<String> styleUrls,
List<AnimationEntryMetadata> animations})
: super(
selector: selector,
inputs: inputs,
outputs: outputs,
properties: properties,
events: events,
host: host,
providers: providers,
exportAs: exportAs,
moduleId: moduleId,
viewProviders: viewProviders,
queries: queries,
changeDetection: changeDetection,
templateUrl: templateUrl,
template: template,
directives: directives,
pipes: pipes,
encapsulation: encapsulation,
styles: styles,
styleUrls: styleUrls,
animations: animations);
}
/**
* See: [ViewMetadata] for docs.
* @deprecated
*/
class View extends ViewMetadata {
const View(
{String templateUrl,
String template,
dynamic directives,
dynamic pipes,
ViewEncapsulation encapsulation,
List<String> styles,
List<String> styleUrls,
List<AnimationEntryMetadata> animations})
: super(
templateUrl: templateUrl,
template: template,
directives: directives,
pipes: pipes,
encapsulation: encapsulation,
styles: styles,
styleUrls: styleUrls,
animations: animations);
}
/**
* See: [PipeMetadata] for docs.
* @stable
*/
class Pipe extends PipeMetadata {
const Pipe({name, pure}) : super(name: name, pure: pure);
}
/**
* See: [AttributeMetadata] for docs.
* @stable
*/
class Attribute extends AttributeMetadata {
const Attribute(String attributeName) : super(attributeName);
}
/**
* See: [QueryMetadata] for docs.
* @deprecated Use ContentChildren/ContentChild instead
*/
class Query extends QueryMetadata {
const Query(dynamic /*Type | string*/ selector,
{bool descendants: false, dynamic read: null})
: super(selector, descendants: descendants, read: read);
}
/**
* See: [ContentChildrenMetadata] for docs.
* @stable
*/
class ContentChildren extends ContentChildrenMetadata {
const ContentChildren(dynamic /*Type | string*/ selector,
{bool descendants: false, dynamic read: null})
: super(selector, descendants: descendants, read: read);
}
/**
* See: [ContentChildMetadata] for docs.
* @stable
*/
class ContentChild extends ContentChildMetadata {
const ContentChild(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
}
/**
* See: [ViewQueryMetadata] for docs.
* @deprecated Use ViewChildren/ViewChild instead
*/
class ViewQuery extends ViewQueryMetadata {
const ViewQuery(dynamic /*Type | string*/ selector, {dynamic read: null})
: super(selector, descendants: true, read: read);
}
/**
* See: [ViewChildrenMetadata] for docs.
* @stable
*/
class ViewChildren extends ViewChildrenMetadata {
const ViewChildren(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
}
/**
* See: [ViewChildMetadata] for docs.
* @stable
*/
class ViewChild extends ViewChildMetadata {
const ViewChild(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
}
/**
* See: [InputMetadata] for docs.
* @stable
*/
class Input extends InputMetadata {
const Input([String bindingPropertyName]) : super(bindingPropertyName);
}
/**
* See: [OutputMetadata] for docs.
* @stable
*/
class Output extends OutputMetadata {
const Output([String bindingPropertyName]) : super(bindingPropertyName);
}
/**
* See: [HostBindingMetadata] for docs.
* @stable
*/
class HostBinding extends HostBindingMetadata {
const HostBinding([String hostPropertyName]) : super(hostPropertyName);
}
/**
* See: [HostListenerMetadata] for docs.
* @stable
*/
class HostListener extends HostListenerMetadata {
const HostListener(String eventName, [List<String> args])
: super(eventName, args);
}
@@ -1,96 +0,0 @@
/**
* Tracing for Dart applications.
*
* The tracing API hooks up to either [WTF](http://google.github.io/tracing-framework/) or
* [Dart Observatory](https://www.dartlang.org/tools/observatory/).
*/
library angular2.src.core.wtf_impl;
typedef dynamic WtfScopeFn([arg0, arg1]);
var context = null;
var _trace;
var _events;
var _createScope;
var _leaveScope;
var _beginTimeRange;
var _endTimeRange;
final List _arg1 = [null];
final List _arg2 = [null, null];
bool detectWTF() {
if (context != null && context.hasProperty('wtf')) {
var wtf = context['wtf'];
if (wtf.hasProperty('trace')) {
_trace = wtf['trace'];
_events = _trace['events'];
_createScope = _events['createScope'];
_leaveScope = _trace['leaveScope'];
_beginTimeRange = _trace['beginTimeRange'];
_endTimeRange = _trace['endTimeRange'];
return true;
}
}
return false;
}
int getArgSize(String signature) {
int start = signature.indexOf('(') + 1;
int end = signature.indexOf(')', start);
bool found = false;
int count = 0;
for (var i = start; i < end; i++) {
var ch = signature[i];
if (identical(ch, ',')) {
found = false;
}
if (!found) {
found = true;
count++;
}
}
return count;
}
dynamic createScope(String signature, [flags]) {
_arg2[0] = signature;
_arg2[1] = flags;
var jsScope = _createScope.apply(_arg2, thisArg: _events);
switch (getArgSize(signature)) {
case 0:
return ([arg0, arg1]) {
return jsScope.apply(const []);
};
case 1:
return ([arg0, arg1]) {
_arg1[0] = arg0;
return jsScope.apply(_arg1);
};
case 2:
return ([arg0, arg1]) {
_arg2[0] = arg0;
_arg2[1] = arg1;
return jsScope.apply(_arg2);
};
default:
throw "Max 2 arguments are supported.";
}
}
void leave(scope, [returnValue]) {
_arg2[0] = scope;
_arg2[1] = returnValue;
_leaveScope.apply(_arg2, thisArg: _trace);
return returnValue;
}
dynamic startTimeRange(String rangeType, String action) {
_arg2[0] = rangeType;
_arg2[1] = action;
return _beginTimeRange.apply(_arg2, thisArg: _trace);
}
void endTimeRange(dynamic range) {
_arg1[0] = range;
_endTimeRange.apply(_arg1, thisArg: _trace);
}
@@ -1,14 +0,0 @@
library angular2.src.core.wtf_init;
import 'dart:js' as js;
import 'wtf_impl.dart' as impl;
/**
* Must be executed explicitly in Dart to set the JS Context.
*
* NOTE: this is done explicitly to allow WTF api not to depend on
* JS context and possible to run the noop WTF stubs outside the browser.
*/
wtfInit() {
impl.context = js.context;
}
@@ -1,63 +0,0 @@
library reflection.debug_reflection_capabilities;
import 'dart:mirrors';
import 'package:logging/logging.dart' as log;
import 'package:stack_trace/stack_trace.dart';
import 'types.dart';
import 'reflection_capabilities.dart' as standard;
class ReflectionCapabilities extends standard.ReflectionCapabilities {
final bool _verbose;
final log.Logger _log = new log.Logger('ReflectionCapabilities');
ReflectionCapabilities({bool verbose: false})
: _verbose = verbose,
super() {
log.hierarchicalLoggingEnabled = true;
_log.level = _verbose ? log.Level.ALL : log.Level.INFO;
_log.onRecord.listen((log.LogRecord rec) {
print('[${rec.loggerName}(${rec.level.name})]: ${rec.message}');
});
}
void _notify(String methodName, param) {
var trace = _verbose ? ' ${Trace.format(new Trace.current())}' : '';
_log.info('"$methodName" requested for "$param".$trace');
}
Function factory(Type type) {
ClassMirror classMirror = reflectType(type);
_notify('factory', '${classMirror.qualifiedName}');
return super.factory(type);
}
List<List> parameters(typeOrFunc) {
_notify('parameters', typeOrFunc);
return super.parameters(typeOrFunc);
}
List annotations(typeOrFunc) {
_notify('annotations', typeOrFunc);
return super.annotations(typeOrFunc);
}
Map propMetadata(typeOrFunc) {
_notify('propMetadata', typeOrFunc);
return super.propMetadata(typeOrFunc);
}
GetterFn getter(String name) {
_notify('getter', name);
return super.getter(name);
}
SetterFn setter(String name) {
_notify('setter', name);
return super.setter(name);
}
MethodFn method(String name) {
_notify('method', name);
return super.method(name);
}
}
@@ -1,59 +0,0 @@
library reflection.reflection;
import 'reflector.dart';
import 'types.dart';
export 'reflector.dart';
import 'platform_reflection_capabilities.dart';
import 'package:angular2/src/facade/lang.dart';
class NoReflectionCapabilities implements PlatformReflectionCapabilities {
@override
bool isReflectionEnabled() {
return false;
}
@override
Function factory(Type type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
List interfaces(Type type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
List<List> parameters(dynamic type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
List annotations(dynamic type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
Map<String, List> propMetadata(dynamic type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
GetterFn getter(String name) {
throw "Cannot find getter ${name}";
}
@override
SetterFn setter(String name) {
throw "Cannot find setter ${name}";
}
@override
MethodFn method(String name) {
throw "Cannot find method ${name}";
}
@override
String importUri(Type type) => './';
}
final Reflector reflector = new Reflector(new NoReflectionCapabilities());
File diff suppressed because it is too large Load Diff
@@ -1,5 +0,0 @@
library reflection.types;
typedef SetterFn(obj, value);
typedef GetterFn(obj);
typedef MethodFn(obj, List args);

Some files were not shown because too many files have changed in this diff Show More