2015-08-14 13:03:45 -04:00
|
|
|
library angular2.src.core.metadata;
|
|
|
|
|
2015-11-06 20:34:07 -05:00
|
|
|
import 'package:angular2/src/facade/collection.dart' show List;
|
2015-08-26 14:44:59 -04:00
|
|
|
import 'package:angular2/src/core/change_detection/change_detection.dart';
|
2015-09-14 18:59:09 -04:00
|
|
|
import './metadata/di.dart';
|
|
|
|
import './metadata/directives.dart';
|
|
|
|
import './metadata/view.dart';
|
2015-08-14 13:03:45 -04:00
|
|
|
|
2015-09-14 18:59:09 -04:00
|
|
|
export './metadata/di.dart';
|
|
|
|
export './metadata/directives.dart';
|
2015-10-05 13:10:07 -04:00
|
|
|
export './metadata/view.dart' hide VIEW_ENCAPSULATION_VALUES;
|
2016-01-06 17:13:44 -05:00
|
|
|
export './metadata/lifecycle_hooks.dart' show
|
|
|
|
AfterContentInit,
|
|
|
|
AfterContentChecked,
|
|
|
|
AfterViewInit,
|
|
|
|
AfterViewChecked,
|
|
|
|
OnChanges,
|
|
|
|
OnDestroy,
|
|
|
|
OnInit,
|
|
|
|
DoCheck;
|
2015-08-14 13:03:45 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [DirectiveMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class Directive extends DirectiveMetadata {
|
2015-10-20 12:38:14 -04:00
|
|
|
const Directive(
|
|
|
|
{String selector,
|
|
|
|
List<String> inputs,
|
|
|
|
List<String> outputs,
|
2015-11-02 17:47:23 -05:00
|
|
|
@Deprecated('Use `inputs` or `@Input` instead')
|
2015-11-02 13:17:17 -05:00
|
|
|
List<String> properties,
|
2015-11-02 17:47:23 -05:00
|
|
|
@Deprecated('Use `outputs` or `@Output` instead')
|
2015-11-02 13:17:17 -05:00
|
|
|
List<String> events,
|
2015-10-20 12:38:14 -04:00
|
|
|
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);
|
2015-08-14 13:03:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [ComponentMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class Component extends ComponentMetadata {
|
2015-10-20 12:38:14 -04:00
|
|
|
const Component(
|
|
|
|
{String selector,
|
|
|
|
List<String> inputs,
|
|
|
|
List<String> outputs,
|
2015-11-02 17:47:23 -05:00
|
|
|
@Deprecated('Use `inputs` or `@Input` instead')
|
2015-11-02 13:17:17 -05:00
|
|
|
List<String> properties,
|
2015-11-02 17:47:23 -05:00
|
|
|
@Deprecated('Use `outputs` or `@Output` instead')
|
2015-11-02 13:17:17 -05:00
|
|
|
List<String> events,
|
2015-10-20 12:38:14 -04:00
|
|
|
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})
|
|
|
|
: 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);
|
2015-08-14 13:03:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [ViewMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class View extends ViewMetadata {
|
2015-10-20 12:38:14 -04:00
|
|
|
const View(
|
|
|
|
{String templateUrl,
|
|
|
|
String template,
|
|
|
|
dynamic directives,
|
|
|
|
dynamic pipes,
|
|
|
|
ViewEncapsulation encapsulation,
|
|
|
|
List<String> styles,
|
|
|
|
List<String> styleUrls})
|
|
|
|
: super(
|
|
|
|
templateUrl: templateUrl,
|
|
|
|
template: template,
|
|
|
|
directives: directives,
|
|
|
|
pipes: pipes,
|
|
|
|
encapsulation: encapsulation,
|
|
|
|
styles: styles,
|
|
|
|
styleUrls: styleUrls);
|
2015-08-14 13:03:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [PipeMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class Pipe extends PipeMetadata {
|
2015-09-08 12:17:58 -04:00
|
|
|
const Pipe({name, pure}) : super(name: name, pure: pure);
|
2015-08-14 13:03:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [AttributeMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class Attribute extends AttributeMetadata {
|
|
|
|
const Attribute(String attributeName) : super(attributeName);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [QueryMetadata] for docs.
|
|
|
|
*/
|
2015-10-26 18:45:44 -04:00
|
|
|
@Deprecated("Use ContentChildren/ContentChild instead")
|
2015-08-14 13:03:45 -04:00
|
|
|
class Query extends QueryMetadata {
|
2016-04-18 16:24:42 -04:00
|
|
|
const Query(dynamic /*Type | string*/ selector,
|
|
|
|
{bool descendants: false, dynamic read: null})
|
|
|
|
: super(selector, descendants: descendants, read: read);
|
2015-08-14 13:03:45 -04:00
|
|
|
}
|
|
|
|
|
2015-09-17 21:45:14 -04:00
|
|
|
/**
|
|
|
|
* See: [ContentChildrenMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class ContentChildren extends ContentChildrenMetadata {
|
2015-10-20 12:38:14 -04:00
|
|
|
const ContentChildren(dynamic /*Type | string*/ selector,
|
2016-04-18 16:24:42 -04:00
|
|
|
{bool descendants: false, dynamic read: null})
|
|
|
|
: super(selector, descendants: descendants, read: read);
|
2015-09-17 21:45:14 -04:00
|
|
|
}
|
|
|
|
|
2015-09-19 21:39:35 -04:00
|
|
|
/**
|
|
|
|
* See: [ContentChildMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class ContentChild extends ContentChildMetadata {
|
2016-04-18 16:24:42 -04:00
|
|
|
const ContentChild(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
|
2015-09-19 21:39:35 -04:00
|
|
|
}
|
|
|
|
|
2015-08-14 13:03:45 -04:00
|
|
|
/**
|
|
|
|
* See: [ViewQueryMetadata] for docs.
|
|
|
|
*/
|
2015-10-26 18:45:44 -04:00
|
|
|
@Deprecated("Use ViewChildren/ViewChild instead")
|
2015-08-14 13:03:45 -04:00
|
|
|
class ViewQuery extends ViewQueryMetadata {
|
2016-04-18 16:24:42 -04:00
|
|
|
const ViewQuery(dynamic /*Type | string*/ selector, {dynamic read: null})
|
|
|
|
: super(selector, descendants: true, read: read);
|
2015-08-14 13:03:45 -04:00
|
|
|
}
|
2015-09-03 18:10:48 -04:00
|
|
|
|
2015-09-17 21:45:14 -04:00
|
|
|
/**
|
|
|
|
* See: [ViewChildrenMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class ViewChildren extends ViewChildrenMetadata {
|
2016-04-18 16:24:42 -04:00
|
|
|
const ViewChildren(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
|
2015-09-17 21:45:14 -04:00
|
|
|
}
|
|
|
|
|
2015-09-19 21:39:35 -04:00
|
|
|
/**
|
|
|
|
* See: [ViewChildMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class ViewChild extends ViewChildMetadata {
|
2016-04-18 16:24:42 -04:00
|
|
|
const ViewChild(dynamic /*Type | string*/ selector, {dynamic read: null}) : super(selector, read: read);
|
2015-09-19 21:39:35 -04:00
|
|
|
}
|
|
|
|
|
2015-09-03 18:10:48 -04:00
|
|
|
/**
|
2015-09-30 23:59:23 -04:00
|
|
|
* See: [InputMetadata] for docs.
|
2015-09-03 18:10:48 -04:00
|
|
|
*/
|
2015-09-30 23:59:23 -04:00
|
|
|
class Input extends InputMetadata {
|
2015-10-20 12:38:14 -04:00
|
|
|
const Input([String bindingPropertyName]) : super(bindingPropertyName);
|
2015-09-03 18:10:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-09-30 23:59:23 -04:00
|
|
|
* See: [OutputMetadata] for docs.
|
2015-09-03 18:10:48 -04:00
|
|
|
*/
|
2015-09-30 23:59:23 -04:00
|
|
|
class Output extends OutputMetadata {
|
2015-10-20 12:38:14 -04:00
|
|
|
const Output([String bindingPropertyName]) : super(bindingPropertyName);
|
2015-08-19 00:51:28 -04:00
|
|
|
}
|
2015-09-04 17:07:16 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [HostBindingMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class HostBinding extends HostBindingMetadata {
|
2015-10-20 12:38:14 -04:00
|
|
|
const HostBinding([String hostPropertyName]) : super(hostPropertyName);
|
2015-09-04 17:07:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See: [HostListenerMetadata] for docs.
|
|
|
|
*/
|
|
|
|
class HostListener extends HostListenerMetadata {
|
|
|
|
const HostListener(String eventName, [List<String> args])
|
2015-10-20 12:38:14 -04:00
|
|
|
: super(eventName, args);
|
|
|
|
}
|