@@ -130,11 +130,6 @@ export class ProtoViewDto {
|
||||
}
|
||||
}
|
||||
|
||||
// group 1: property from "[property]"
|
||||
// group 2: event from "(event)"
|
||||
// group 3: action from "@action"
|
||||
var hostRegExp = RegExpWrapper.create('^(?:(?:\\[([^\\]]+)\\])|(?:\\(([^\\)]+)\\))|(?:@(.+)))$');
|
||||
|
||||
export class DirectiveMetadata {
|
||||
static get DIRECTIVE_TYPE() { return 0; }
|
||||
static get COMPONENT_TYPE() { return 1; }
|
||||
@@ -156,6 +151,10 @@ export class DirectiveMetadata {
|
||||
hostProperties: Map<string, string>;
|
||||
hostAttributes: Map<string, string>;
|
||||
hostActions: Map<string, string>;
|
||||
// group 1: "property" from "[property]"
|
||||
// group 2: "event" from "(event)"
|
||||
// group 3: "action" from "@action"
|
||||
private static _hostRegExp = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\))|(?:@(.+)))$/g;
|
||||
|
||||
constructor({id, selector, compileChildren, events, hostListeners, hostProperties, hostAttributes,
|
||||
hostActions, properties, readAttributes, type, callOnDestroy, callOnChange,
|
||||
@@ -225,7 +224,7 @@ export class DirectiveMetadata {
|
||||
|
||||
if (isPresent(host)) {
|
||||
MapWrapper.forEach(host, (value: string, key: string) => {
|
||||
var matches = RegExpWrapper.firstMatch(hostRegExp, key);
|
||||
var matches = RegExpWrapper.firstMatch(DirectiveMetadata._hostRegExp, key);
|
||||
if (isBlank(matches)) {
|
||||
hostAttributes.set(key, value);
|
||||
} else if (isPresent(matches[1])) {
|
||||
|
||||
Reference in New Issue
Block a user