feat(WebWorkers): Add WebSocket MessageBuses for debugging apps
Closes #3858
This commit is contained in:
@ -47,7 +47,7 @@ import {
|
||||
import {QueryList} from './query_list';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
import {RenderDirectiveMetadata} from 'angular2/src/core/render/api';
|
||||
import {EventConfig} from 'angular2/src/core/render/dom/util';
|
||||
import {EventConfig} from 'angular2/src/core/render/event_config';
|
||||
import {PipeBinding} from '../pipes/pipe_binding';
|
||||
|
||||
var _staticKeys;
|
||||
|
@ -1,7 +1,13 @@
|
||||
import {Injectable} from 'angular2/di';
|
||||
|
||||
import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {isPresent, isBlank, BaseException, assertionsEnabled} from 'angular2/src/core/facade/lang';
|
||||
import {
|
||||
StringWrapper,
|
||||
isPresent,
|
||||
isBlank,
|
||||
BaseException,
|
||||
assertionsEnabled
|
||||
} from 'angular2/src/core/facade/lang';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
|
||||
import {
|
||||
@ -505,7 +511,7 @@ function _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, e
|
||||
}
|
||||
}
|
||||
|
||||
if (isBlank(matchedDirective) && exportAs !== "$implicit") {
|
||||
if (isBlank(matchedDirective) && !StringWrapper.equals(exportAs, "$implicit")) {
|
||||
throw new BaseException(`Cannot find directive with exportAs = '${exportAs}'`);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,8 @@ import {CompileElement} from './compile_element';
|
||||
import {CompileControl} from './compile_control';
|
||||
|
||||
import {RenderDirectiveMetadata} from '../../api';
|
||||
import {EventConfig, dashCaseToCamelCase, camelCaseToDashCase} from '../util';
|
||||
import {dashCaseToCamelCase, camelCaseToDashCase} from '../util';
|
||||
import {EventConfig} from '../../event_config';
|
||||
import {DirectiveBuilder, ElementBinderBuilder} from '../view/proto_view_builder';
|
||||
|
||||
/**
|
||||
|
@ -8,8 +8,6 @@ import {TemplateCloner} from './template_cloner';
|
||||
export const NG_BINDING_CLASS_SELECTOR = '.ng-binding';
|
||||
export const NG_BINDING_CLASS = 'ng-binding';
|
||||
|
||||
export const EVENT_TARGET_SEPARATOR = ':';
|
||||
|
||||
export const NG_CONTENT_ELEMENT_NAME = 'ng-content';
|
||||
export const NG_SHADOW_ROOT_ELEMENT_NAME = 'shadow-root';
|
||||
|
||||
@ -29,27 +27,6 @@ export function dashCaseToCamelCase(input: string): string {
|
||||
(m) => { return m[1].toUpperCase(); });
|
||||
}
|
||||
|
||||
export class EventConfig {
|
||||
constructor(public fieldName: string, public eventName: string, public isLongForm: boolean) {}
|
||||
|
||||
static parse(eventConfig: string): EventConfig {
|
||||
var fieldName = eventConfig, eventName = eventConfig, isLongForm = false;
|
||||
var separatorIdx = eventConfig.indexOf(EVENT_TARGET_SEPARATOR);
|
||||
if (separatorIdx > -1) {
|
||||
// long format: 'fieldName: eventName'
|
||||
fieldName = StringWrapper.substring(eventConfig, 0, separatorIdx).trim();
|
||||
eventName = StringWrapper.substring(eventConfig, separatorIdx + 1).trim();
|
||||
isLongForm = true;
|
||||
}
|
||||
return new EventConfig(fieldName, eventName, isLongForm);
|
||||
}
|
||||
|
||||
getFullName(): string {
|
||||
return this.isLongForm ? `${this.fieldName}${EVENT_TARGET_SEPARATOR}${this.eventName}` :
|
||||
this.eventName;
|
||||
}
|
||||
}
|
||||
|
||||
// Attention: This is on the hot path, so don't use closures or default values!
|
||||
export function queryBoundElements(templateContent: Node, isSingleElementChild: boolean):
|
||||
Element[] {
|
||||
|
@ -34,12 +34,8 @@ import {
|
||||
PropertyBindingType
|
||||
} from '../../api';
|
||||
|
||||
import {
|
||||
NG_BINDING_CLASS,
|
||||
EVENT_TARGET_SEPARATOR,
|
||||
queryBoundTextNodeIndices,
|
||||
camelCaseToDashCase
|
||||
} from '../util';
|
||||
import {NG_BINDING_CLASS, queryBoundTextNodeIndices, camelCaseToDashCase} from '../util';
|
||||
import {EVENT_TARGET_SEPARATOR} from "../../event_config";
|
||||
|
||||
export class ProtoViewBuilder {
|
||||
variableBindings: Map<string, string> = new Map();
|
||||
|
23
modules/angular2/src/core/render/event_config.ts
Normal file
23
modules/angular2/src/core/render/event_config.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import {StringWrapper} from 'angular2/src/core/facade/lang';
|
||||
export const EVENT_TARGET_SEPARATOR = ':';
|
||||
|
||||
export class EventConfig {
|
||||
constructor(public fieldName: string, public eventName: string, public isLongForm: boolean) {}
|
||||
|
||||
static parse(eventConfig: string): EventConfig {
|
||||
var fieldName = eventConfig, eventName = eventConfig, isLongForm = false;
|
||||
var separatorIdx = eventConfig.indexOf(EVENT_TARGET_SEPARATOR);
|
||||
if (separatorIdx > -1) {
|
||||
// long format: 'fieldName: eventName'
|
||||
fieldName = StringWrapper.substring(eventConfig, 0, separatorIdx).trim();
|
||||
eventName = StringWrapper.substring(eventConfig, separatorIdx + 1).trim();
|
||||
isLongForm = true;
|
||||
}
|
||||
return new EventConfig(fieldName, eventName, isLongForm);
|
||||
}
|
||||
|
||||
getFullName(): string {
|
||||
return this.isLongForm ? `${this.fieldName}${EVENT_TARGET_SEPARATOR}${this.eventName}` :
|
||||
this.eventName;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user