Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {CONST_EXPR, isPresent, NumberWrapper, StringWrapper} from 'angular2/src/facade/lang';
import {MapWrapper, Map, ListWrapper} from 'angular2/src/facade/collection';
import {Injectable, provide, Provider} from 'angular2/src/core/di';
import {AppViewListener} from 'angular2/src/core/linker/view_listener';
import {AppView} from 'angular2/src/core/linker/view';
import {DOM} from 'angular2/src/core/dom/dom_adapter';
import {Renderer} from 'angular2/src/core/render/api';
import {DebugElement, DebugElement_} from './debug_element';
const NG_ID_PROPERTY = 'ngid';
const INSPECT_GLOBAL_NAME = 'ng.probe';
const NG_ID_SEPARATOR = '#';
// Need to keep the views in a global Map so that multiple angular apps are supported
var _allIdsByView = new Map();
var _allViewsById = new Map();
var _nextId = 0;
function _setElementId(element, indices: number[]) {
if (isPresent(element) && DOM.isElementNode(element)) {
DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR));
}
}
function _getElementId(element): number[] {
var elId = DOM.getData(element, NG_ID_PROPERTY);
if (isPresent(elId)) {
return elId.split(NG_ID_SEPARATOR).map(partStr => NumberWrapper.parseInt(partStr, 10));
} else {
return null;
function MockDirectiveResolver() {
_super.apply(this, arguments);
this._providerOverrides = new collection_1.Map();
this.viewProviderOverrides = new collection_1.Map();
}
MockDirectiveResolver.prototype.resolve = function(type) {
function MockXHR() {
_super.apply(this, arguments);
this._expectations = [];
this._definitions = new collection_1.Map();
this._requests = [];
}
MockXHR.prototype.get = function(url) {
constructor() {
this._elementMap = new Map();
this._elementPartialMap = new Map();
this._classMap = new Map();
this._classPartialMap = new Map();
this._attrValueMap = new Map();
this._attrValuePartialMap = new Map();
this._listContexts = [];
}
static createNotMatcher(notSelectors) {
function RouteRegistry(_rootComponent) {
this._rootComponent = _rootComponent;
this._rules = new collection_1.Map();
}
RouteRegistry.prototype.config = function(parentComponent, config) {
function ServiceMessageBroker_(messageBus, _serializer, channel) {
var _this = this;
_super.call(this);
this._serializer = _serializer;
this.channel = channel;
this._methods = new collection_1.Map();
this._sink = messageBus.to(channel);
var source = messageBus.from(channel);
async_1.ObservableWrapper.subscribe(source, function (message) { return _this._handleMessage(message); });
}
ServiceMessageBroker_.prototype.registerMethod = function (methodName, signature, method, returnType) {
objectToMap(obj, type, data) {
if (isPresent(type)) {
var map = new Map();
StringMapWrapper.forEach(obj, (val, key) => { map.set(key, this.deserialize(val, type, data)); });
return map;
}
else {
return MapWrapper.createFromStringMap(obj);
}
}
_serializeLocation(loc) {
function MockXHR() {
_super.apply(this, arguments);
this._expectations = [];
this._definitions = new collection_1.Map();
this._requests = [];
}
MockXHR.prototype.get = function (url) {
function ServiceMessageBroker_(messageBus, _serializer, channel) {
var _this = this;
_super.call(this);
this._serializer = _serializer;
this.channel = channel;
this._methods = new collection_1.Map();
this._sink = messageBus.to(channel);
var source = messageBus.from(channel);
async_1.ObservableWrapper.subscribe(source, function (message) { return _this._handleMessage(message); });
}
ServiceMessageBroker_.prototype.registerMethod = function (methodName, signature, method, returnType) {
function Headers(headers) {
var _this = this;
if (headers instanceof Headers) {
this._headersMap = headers._headersMap;
return ;
}
this._headersMap = new collection_1.Map();
if (lang_1.isBlank(headers)) {
return ;
}
collection_1.StringMapWrapper.forEach(headers, function(v, k) {
_this._headersMap.set(k, collection_1.isListLikeIterable(v) ? v : [v]);
});
}
Headers.fromResponseHeaderString = function(headersString) {