Socket
Socket
Sign inDemoInstall

@angular/core

Package Overview
Dependencies
Maintainers
1
Versions
839
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/core - npm Package Compare versions

Comparing version 4.0.0-rc.1 to 4.0.0-rc.2

typings/src/animation/animation_metadata_wrapped.d.ts

1199

@angular/core/testing.es5.js

@@ -1,3 +0,13 @@

import { getDebugNode, InjectionToken, NgZone, Injector, NgModule, ReflectiveInjector, ɵERROR_COMPONENT_TYPE, Compiler, AUTO_STYLE } from '@angular/core';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
import { getDebugNode, InjectionToken, NgZone, Injector, NgModule, ReflectiveInjector, ɵERROR_COMPONENT_TYPE, Compiler } from '@angular/core';
/**

@@ -10,3 +20,3 @@ * @license

*/
const _global = typeof window === 'undefined' ? global : window;
var _global = typeof window === 'undefined' ? global : window;
/**

@@ -38,3 +48,3 @@ * Wraps a test function in an asynchronous test zone. The test will automatically

// fake it here and assume sync.
done = function () {};
done = function done() {};
done.fail = function (e) {

@@ -44,3 +54,3 @@ throw e;

}
runInTestZone(fn, this, done, err => {
runInTestZone(fn, this, done, function (err) {
if (typeof err === 'string') {

@@ -59,4 +69,6 @@ return done.fail(new Error(err));

return function () {
return new Promise((finishCallback, failCallback) => {
runInTestZone(fn, this, finishCallback, failCallback);
var _this = this;
return new Promise(function (finishCallback, failCallback) {
runInTestZone(fn, _this, finishCallback, failCallback);
});

@@ -66,21 +78,21 @@ };

function runInTestZone(fn, context, finishCallback, failCallback) {
const currentZone = Zone.current;
const AsyncTestZoneSpec = Zone['AsyncTestZoneSpec'];
var currentZone = Zone.current;
var AsyncTestZoneSpec = Zone['AsyncTestZoneSpec'];
if (AsyncTestZoneSpec === undefined) {
throw new Error('AsyncTestZoneSpec is needed for the async() test helper but could not be found. ' + 'Please make sure that your environment includes zone.js/dist/async-test.js');
}
const ProxyZoneSpec = Zone['ProxyZoneSpec'];
var ProxyZoneSpec = Zone['ProxyZoneSpec'];
if (ProxyZoneSpec === undefined) {
throw new Error('ProxyZoneSpec is needed for the async() test helper but could not be found. ' + 'Please make sure that your environment includes zone.js/dist/proxy.js');
}
const proxyZoneSpec = ProxyZoneSpec.get();
var proxyZoneSpec = ProxyZoneSpec.get();
ProxyZoneSpec.assertPresent();
// We need to create the AsyncTestZoneSpec outside the ProxyZone.
// If we do it in ProxyZone then we will get to infinite recursion.
const proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');
const previousDelegate = proxyZoneSpec.getDelegate();
proxyZone.parent.run(() => {
const testZoneSpec = new AsyncTestZoneSpec(() => {
var proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');
var previousDelegate = proxyZoneSpec.getDelegate();
proxyZone.parent.run(function () {
var testZoneSpec = new AsyncTestZoneSpec(function () {
// Need to restore the original zone.
currentZone.run(() => {
currentZone.run(function () {
if (proxyZoneSpec.getDelegate() == testZoneSpec) {

@@ -92,5 +104,5 @@ // Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.

});
}, error => {
}, function (error) {
// Need to restore the original zone.
currentZone.run(() => {
currentZone.run(function () {
if (proxyZoneSpec.getDelegate() == testZoneSpec) {

@@ -119,9 +131,9 @@ // Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.

if (token.overriddenName) {
return `${token.overriddenName}`;
return '' + token.overriddenName;
}
if (token.name) {
return `${token.name}`;
return '' + token.name;
}
const res = token.toString();
const newLineIndex = res.indexOf('\n');
var res = token.toString();
var newLineIndex = res.indexOf('\n');
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);

@@ -135,4 +147,9 @@ }

*/
class ComponentFixture {
constructor(componentRef, ngZone, _autoDetect) {
var ComponentFixture = function () {
function ComponentFixture(componentRef, ngZone, _autoDetect) {
var _this2 = this;
_classCallCheck(this, ComponentFixture);
this.componentRef = componentRef;

@@ -156,11 +173,11 @@ this.ngZone = ngZone;

if (ngZone != null) {
this._onUnstableSubscription = ngZone.onUnstable.subscribe({ next: () => {
this._isStable = false;
this._onUnstableSubscription = ngZone.onUnstable.subscribe({ next: function next() {
_this2._isStable = false;
} });
this._onMicrotaskEmptySubscription = ngZone.onMicrotaskEmpty.subscribe({
next: () => {
if (this._autoDetect) {
next: function next() {
if (_this2._autoDetect) {
// Do a change detection run with checkNoChanges set to true to check
// there are no changes on the second run.
this.detectChanges(true);
_this2.detectChanges(true);
}

@@ -170,15 +187,15 @@ }

this._onStableSubscription = ngZone.onStable.subscribe({
next: () => {
this._isStable = true;
next: function next() {
_this2._isStable = true;
// Check whether there is a pending whenStable() completer to resolve.
if (this._promise !== null) {
if (_this2._promise !== null) {
// If so check whether there are no pending macrotasks before resolving.
// Do this check in the next tick so that ngZone gets a chance to update the state of
// pending macrotasks.
scheduleMicroTask(() => {
if (!this.ngZone.hasPendingMacrotasks) {
if (this._promise !== null) {
this._resolve(true);
this._resolve = null;
this._promise = null;
scheduleMicroTask(function () {
if (!_this2.ngZone.hasPendingMacrotasks) {
if (_this2._promise !== null) {
_this2._resolve(true);
_this2._resolve = null;
_this2._promise = null;
}

@@ -190,3 +207,3 @@ }

});
this._onErrorSubscription = ngZone.onError.subscribe({ next: error => {
this._onErrorSubscription = ngZone.onError.subscribe({ next: function next(error) {
throw error;

@@ -196,93 +213,125 @@ } });

}
_tick(checkNoChanges) {
this.changeDetectorRef.detectChanges();
if (checkNoChanges) {
this.checkNoChanges();
_createClass(ComponentFixture, [{
key: '_tick',
value: function _tick(checkNoChanges) {
this.changeDetectorRef.detectChanges();
if (checkNoChanges) {
this.checkNoChanges();
}
}
}
/**
* Trigger a change detection cycle for the component.
*/
detectChanges(checkNoChanges = true) {
if (this.ngZone != null) {
// Run the change detection inside the NgZone so that any async tasks as part of the change
// detection are captured by the zone and can be waited for in isStable.
this.ngZone.run(() => {
/**
* Trigger a change detection cycle for the component.
*/
}, {
key: 'detectChanges',
value: function detectChanges() {
var _this3 = this;
var checkNoChanges = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
if (this.ngZone != null) {
// Run the change detection inside the NgZone so that any async tasks as part of the change
// detection are captured by the zone and can be waited for in isStable.
this.ngZone.run(function () {
_this3._tick(checkNoChanges);
});
} else {
// Running without zone. Just do the change detection.
this._tick(checkNoChanges);
});
} else {
// Running without zone. Just do the change detection.
this._tick(checkNoChanges);
}
}
}
/**
* Do a change detection run to make sure there were no changes.
*/
checkNoChanges() {
this.changeDetectorRef.checkNoChanges();
}
/**
* Set whether the fixture should autodetect changes.
*
* Also runs detectChanges once so that any existing change is detected.
*/
autoDetectChanges(autoDetect = true) {
if (this.ngZone == null) {
throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set');
/**
* Do a change detection run to make sure there were no changes.
*/
}, {
key: 'checkNoChanges',
value: function checkNoChanges() {
this.changeDetectorRef.checkNoChanges();
}
this._autoDetect = autoDetect;
this.detectChanges();
}
/**
* Return whether the fixture is currently stable or has async tasks that have not been completed
* yet.
*/
isStable() {
return this._isStable && !this.ngZone.hasPendingMacrotasks;
}
/**
* Get a promise that resolves when the fixture is stable.
*
* This can be used to resume testing after events have triggered asynchronous activity or
* asynchronous change detection.
*/
whenStable() {
if (this.isStable()) {
return Promise.resolve(false);
} else if (this._promise !== null) {
return this._promise;
} else {
this._promise = new Promise(res => {
this._resolve = res;
});
return this._promise;
/**
* Set whether the fixture should autodetect changes.
*
* Also runs detectChanges once so that any existing change is detected.
*/
}, {
key: 'autoDetectChanges',
value: function autoDetectChanges() {
var autoDetect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
if (this.ngZone == null) {
throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set');
}
this._autoDetect = autoDetect;
this.detectChanges();
}
}
/**
* Trigger component destruction.
*/
destroy() {
if (!this._isDestroyed) {
this.componentRef.destroy();
if (this._onUnstableSubscription != null) {
this._onUnstableSubscription.unsubscribe();
this._onUnstableSubscription = null;
/**
* Return whether the fixture is currently stable or has async tasks that have not been completed
* yet.
*/
}, {
key: 'isStable',
value: function isStable() {
return this._isStable && !this.ngZone.hasPendingMacrotasks;
}
/**
* Get a promise that resolves when the fixture is stable.
*
* This can be used to resume testing after events have triggered asynchronous activity or
* asynchronous change detection.
*/
}, {
key: 'whenStable',
value: function whenStable() {
var _this4 = this;
if (this.isStable()) {
return Promise.resolve(false);
} else if (this._promise !== null) {
return this._promise;
} else {
this._promise = new Promise(function (res) {
_this4._resolve = res;
});
return this._promise;
}
if (this._onStableSubscription != null) {
this._onStableSubscription.unsubscribe();
this._onStableSubscription = null;
}
/**
* Trigger component destruction.
*/
}, {
key: 'destroy',
value: function destroy() {
if (!this._isDestroyed) {
this.componentRef.destroy();
if (this._onUnstableSubscription != null) {
this._onUnstableSubscription.unsubscribe();
this._onUnstableSubscription = null;
}
if (this._onStableSubscription != null) {
this._onStableSubscription.unsubscribe();
this._onStableSubscription = null;
}
if (this._onMicrotaskEmptySubscription != null) {
this._onMicrotaskEmptySubscription.unsubscribe();
this._onMicrotaskEmptySubscription = null;
}
if (this._onErrorSubscription != null) {
this._onErrorSubscription.unsubscribe();
this._onErrorSubscription = null;
}
this._isDestroyed = true;
}
if (this._onMicrotaskEmptySubscription != null) {
this._onMicrotaskEmptySubscription.unsubscribe();
this._onMicrotaskEmptySubscription = null;
}
if (this._onErrorSubscription != null) {
this._onErrorSubscription.unsubscribe();
this._onErrorSubscription = null;
}
this._isDestroyed = true;
}
}
}
}]);
return ComponentFixture;
}();
/**

@@ -295,5 +344,7 @@ * @license

*/
const FakeAsyncTestZoneSpec = Zone['FakeAsyncTestZoneSpec'];
const ProxyZoneSpec = Zone['ProxyZoneSpec'];
let _fakeAsyncTestZoneSpec = null;
var FakeAsyncTestZoneSpec = Zone['FakeAsyncTestZoneSpec'];
var ProxyZoneSpec = Zone['ProxyZoneSpec'];
var _fakeAsyncTestZoneSpec = null;
/**

@@ -309,3 +360,3 @@ * Clears out the shared fake async zone for a test.

}
let _inFakeAsyncCall = false;
var _inFakeAsyncCall = false;
/**

@@ -331,4 +382,4 @@ * Wraps a function to be executed in the fakeAsync zone:

// Not using an arrow function to preserve context passed from call site
return function (...args) {
const proxyZoneSpec = ProxyZoneSpec.assertPresent();
return function () {
var proxyZoneSpec = ProxyZoneSpec.assertPresent();
if (_inFakeAsyncCall) {

@@ -345,6 +396,10 @@ throw new Error('fakeAsync() calls can not be nested');

}
let res;
const lastProxyZoneSpec = proxyZoneSpec.getDelegate();
var res = void 0;
var lastProxyZoneSpec = proxyZoneSpec.getDelegate();
proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec);
try {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
res = fn.apply(this, args);

@@ -356,6 +411,6 @@ flushMicrotasks();

if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {
throw new Error(`${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} ` + `periodic timer(s) still in the queue.`);
throw new Error(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length + ' ' + 'periodic timer(s) still in the queue.');
}
if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {
throw new Error(`${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`);
throw new Error(_fakeAsyncTestZoneSpec.pendingTimers.length + ' timer(s) still in the queue.');
}

@@ -387,3 +442,5 @@ return res;

*/
function tick(millis = 0) {
function tick() {
var millis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
_getFakeAsyncZoneSpec().tick(millis);

@@ -397,4 +454,4 @@ }

function discardPeriodicTasks() {
const zoneSpec = _getFakeAsyncZoneSpec();
const pendingTimers = zoneSpec.pendingPeriodicTimers;
var zoneSpec = _getFakeAsyncZoneSpec();
var pendingTimers = zoneSpec.pendingPeriodicTimers;
zoneSpec.pendingPeriodicTimers.length = 0;

@@ -427,20 +484,35 @@ }

* found in the LICENSE file at https://angular.io/license
*/class AsyncTestCompleter {
constructor() {
this._promise = new Promise((res, rej) => {
this._resolve = res;
this._reject = rej;
*/
var AsyncTestCompleter = function () {
function AsyncTestCompleter() {
var _this5 = this;
_classCallCheck(this, AsyncTestCompleter);
this._promise = new Promise(function (res, rej) {
_this5._resolve = res;
_this5._reject = rej;
});
}
done(value) {
this._resolve(value);
}
fail(error, stackTrace) {
this._reject(error);
}
get promise() {
return this._promise;
}
}
_createClass(AsyncTestCompleter, [{
key: 'done',
value: function done(value) {
this._resolve(value);
}
}, {
key: 'fail',
value: function fail(error, stackTrace) {
this._reject(error);
}
}, {
key: 'promise',
get: function get() {
return this._promise;
}
}]);
return AsyncTestCompleter;
}();
function unimplemented() {

@@ -454,19 +526,41 @@ throw Error('unimplemented');

*/
class TestingCompiler extends Compiler {
get injector() {
throw unimplemented();
var TestingCompiler = function (_Compiler) {
_inherits(TestingCompiler, _Compiler);
function TestingCompiler() {
_classCallCheck(this, TestingCompiler);
return _possibleConstructorReturn(this, (TestingCompiler.__proto__ || Object.getPrototypeOf(TestingCompiler)).apply(this, arguments));
}
overrideModule(module, overrides) {
throw unimplemented();
}
overrideDirective(directive, overrides) {
throw unimplemented();
}
overrideComponent(component, overrides) {
throw unimplemented();
}
overridePipe(directive, overrides) {
throw unimplemented();
}
}
_createClass(TestingCompiler, [{
key: 'overrideModule',
value: function overrideModule(module, overrides) {
throw unimplemented();
}
}, {
key: 'overrideDirective',
value: function overrideDirective(directive, overrides) {
throw unimplemented();
}
}, {
key: 'overrideComponent',
value: function overrideComponent(component, overrides) {
throw unimplemented();
}
}, {
key: 'overridePipe',
value: function overridePipe(directive, overrides) {
throw unimplemented();
}
}, {
key: 'injector',
get: function get() {
throw unimplemented();
}
}]);
return TestingCompiler;
}(Compiler);
/**

@@ -477,5 +571,9 @@ * A factory for creating a Compiler

*/
class TestingCompilerFactory {}
const UNDEFINED = new Object();
var TestingCompilerFactory = function TestingCompilerFactory() {
_classCallCheck(this, TestingCompilerFactory);
};
var UNDEFINED = new Object();
/**

@@ -486,14 +584,25 @@ * An abstract class for inserting the root test component element in a platform independent way.

*/
class TestComponentRenderer {
insertRootElement(rootElementId) {}
}
let _nextRootElementId = 0;
var TestComponentRenderer = function () {
function TestComponentRenderer() {
_classCallCheck(this, TestComponentRenderer);
}
_createClass(TestComponentRenderer, [{
key: 'insertRootElement',
value: function insertRootElement(rootElementId) {}
}]);
return TestComponentRenderer;
}();
var _nextRootElementId = 0;
/**
* @experimental
*/
const ComponentFixtureAutoDetect = new InjectionToken('ComponentFixtureAutoDetect');
var ComponentFixtureAutoDetect = new InjectionToken('ComponentFixtureAutoDetect');
/**
* @experimental
*/
const ComponentFixtureNoNgZone = new InjectionToken('ComponentFixtureNoNgZone');
var ComponentFixtureNoNgZone = new InjectionToken('ComponentFixtureNoNgZone');
/**

@@ -508,4 +617,7 @@ * @whatItDoes Configures and initializes environment for unit testing and provides methods for

*/
class TestBed {
constructor() {
var TestBed = function () {
function TestBed() {
_classCallCheck(this, TestBed);
this._instantiated = false;

@@ -541,240 +653,350 @@ this._compiler = null;

*/
static initTestEnvironment(ngModule, platform) {
const testBed = getTestBed();
testBed.initTestEnvironment(ngModule, platform);
return testBed;
}
/**
* Reset the providers for the test injector.
*
* @experimental
*/
static resetTestEnvironment() {
getTestBed().resetTestEnvironment();
}
static resetTestingModule() {
getTestBed().resetTestingModule();
return TestBed;
}
/**
* Allows overriding default compiler providers and settings
* which are defined in test_injector.js
*/
static configureCompiler(config) {
getTestBed().configureCompiler(config);
return TestBed;
}
/**
* Allows overriding default providers, directives, pipes, modules of the test injector,
* which are defined in test_injector.js
*/
static configureTestingModule(moduleDef) {
getTestBed().configureTestingModule(moduleDef);
return TestBed;
}
/**
* Compile components with a `templateUrl` for the test's NgModule.
* It is necessary to call this function
* as fetching urls is asynchronous.
*/
static compileComponents() {
return getTestBed().compileComponents();
}
static overrideModule(ngModule, override) {
getTestBed().overrideModule(ngModule, override);
return TestBed;
}
static overrideComponent(component, override) {
getTestBed().overrideComponent(component, override);
return TestBed;
}
static overrideDirective(directive, override) {
getTestBed().overrideDirective(directive, override);
return TestBed;
}
static overridePipe(pipe, override) {
getTestBed().overridePipe(pipe, override);
return TestBed;
}
static overrideTemplate(component, template) {
getTestBed().overrideComponent(component, { set: { template, templateUrl: null } });
return TestBed;
}
static get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND) {
return getTestBed().get(token, notFoundValue);
}
static createComponent(component) {
return getTestBed().createComponent(component);
}
/**
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
* angular module. These are common to every test in the suite.
*
* This may only be called once, to set up the common providers for the current test
* suite on the current platform. If you absolutely need to change the providers,
* first use `resetTestEnvironment`.
*
* Test modules and platforms for individual platforms are available from
* '@angular/<platform_name>/testing'.
*
* @experimental
*/
initTestEnvironment(ngModule, platform) {
if (this.platform || this.ngModule) {
throw new Error('Cannot set base providers because it has already been called');
_createClass(TestBed, [{
key: 'initTestEnvironment',
/**
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
* angular module. These are common to every test in the suite.
*
* This may only be called once, to set up the common providers for the current test
* suite on the current platform. If you absolutely need to change the providers,
* first use `resetTestEnvironment`.
*
* Test modules and platforms for individual platforms are available from
* '@angular/<platform_name>/testing'.
*
* @experimental
*/
value: function initTestEnvironment(ngModule, platform) {
if (this.platform || this.ngModule) {
throw new Error('Cannot set base providers because it has already been called');
}
this.platform = platform;
this.ngModule = ngModule;
}
this.platform = platform;
this.ngModule = ngModule;
}
/**
* Reset the providers for the test injector.
*
* @experimental
*/
resetTestEnvironment() {
this.resetTestingModule();
this.platform = null;
this.ngModule = null;
}
resetTestingModule() {
this._compiler = null;
this._moduleOverrides = [];
this._componentOverrides = [];
this._directiveOverrides = [];
this._pipeOverrides = [];
this._moduleRef = null;
this._moduleWithComponentFactories = null;
this._compilerOptions = [];
this._providers = [];
this._declarations = [];
this._imports = [];
this._schemas = [];
this._instantiated = false;
this._activeFixtures.forEach(fixture => fixture.destroy());
this._activeFixtures = [];
}
configureCompiler(config) {
this._assertNotInstantiated('TestBed.configureCompiler', 'configure the compiler');
this._compilerOptions.push(config);
}
configureTestingModule(moduleDef) {
this._assertNotInstantiated('TestBed.configureTestingModule', 'configure the test module');
if (moduleDef.providers) {
this._providers.push(...moduleDef.providers);
/**
* Reset the providers for the test injector.
*
* @experimental
*/
}, {
key: 'resetTestEnvironment',
value: function resetTestEnvironment() {
this.resetTestingModule();
this.platform = null;
this.ngModule = null;
}
if (moduleDef.declarations) {
this._declarations.push(...moduleDef.declarations);
}, {
key: 'resetTestingModule',
value: function resetTestingModule() {
this._compiler = null;
this._moduleOverrides = [];
this._componentOverrides = [];
this._directiveOverrides = [];
this._pipeOverrides = [];
this._moduleRef = null;
this._moduleWithComponentFactories = null;
this._compilerOptions = [];
this._providers = [];
this._declarations = [];
this._imports = [];
this._schemas = [];
this._instantiated = false;
this._activeFixtures.forEach(function (fixture) {
return fixture.destroy();
});
this._activeFixtures = [];
}
if (moduleDef.imports) {
this._imports.push(...moduleDef.imports);
}, {
key: 'configureCompiler',
value: function configureCompiler(config) {
this._assertNotInstantiated('TestBed.configureCompiler', 'configure the compiler');
this._compilerOptions.push(config);
}
if (moduleDef.schemas) {
this._schemas.push(...moduleDef.schemas);
}, {
key: 'configureTestingModule',
value: function configureTestingModule(moduleDef) {
this._assertNotInstantiated('TestBed.configureTestingModule', 'configure the test module');
if (moduleDef.providers) {
var _providers;
(_providers = this._providers).push.apply(_providers, _toConsumableArray(moduleDef.providers));
}
if (moduleDef.declarations) {
var _declarations;
(_declarations = this._declarations).push.apply(_declarations, _toConsumableArray(moduleDef.declarations));
}
if (moduleDef.imports) {
var _imports;
(_imports = this._imports).push.apply(_imports, _toConsumableArray(moduleDef.imports));
}
if (moduleDef.schemas) {
var _schemas;
(_schemas = this._schemas).push.apply(_schemas, _toConsumableArray(moduleDef.schemas));
}
}
}
compileComponents() {
if (this._moduleWithComponentFactories || this._instantiated) {
return Promise.resolve(null);
}, {
key: 'compileComponents',
value: function compileComponents() {
var _this7 = this;
if (this._moduleWithComponentFactories || this._instantiated) {
return Promise.resolve(null);
}
var moduleType = this._createCompilerAndModule();
return this._compiler.compileModuleAndAllComponentsAsync(moduleType).then(function (moduleAndComponentFactories) {
_this7._moduleWithComponentFactories = moduleAndComponentFactories;
});
}
const moduleType = this._createCompilerAndModule();
return this._compiler.compileModuleAndAllComponentsAsync(moduleType).then(moduleAndComponentFactories => {
this._moduleWithComponentFactories = moduleAndComponentFactories;
});
}
_initIfNeeded() {
if (this._instantiated) {
return;
}
if (!this._moduleWithComponentFactories) {
try {
const moduleType = this._createCompilerAndModule();
this._moduleWithComponentFactories = this._compiler.compileModuleAndAllComponentsSync(moduleType);
} catch (e) {
if (getComponentType(e)) {
throw new Error(`This test module uses the component ${stringify(getComponentType(e))} which is using a "templateUrl" or "styleUrls", but they were never compiled. ` + `Please call "TestBed.compileComponents" before your test.`);
} else {
throw e;
}, {
key: '_initIfNeeded',
value: function _initIfNeeded() {
if (this._instantiated) {
return;
}
if (!this._moduleWithComponentFactories) {
try {
var moduleType = this._createCompilerAndModule();
this._moduleWithComponentFactories = this._compiler.compileModuleAndAllComponentsSync(moduleType);
} catch (e) {
if (getComponentType(e)) {
throw new Error('This test module uses the component ' + stringify(getComponentType(e)) + ' which is using a "templateUrl" or "styleUrls", but they were never compiled. ' + 'Please call "TestBed.compileComponents" before your test.');
} else {
throw e;
}
}
}
var ngZone = new NgZone({ enableLongStackTrace: true });
var ngZoneInjector = ReflectiveInjector.resolveAndCreate([{ provide: NgZone, useValue: ngZone }], this.platform.injector);
this._moduleRef = this._moduleWithComponentFactories.ngModuleFactory.create(ngZoneInjector);
this._instantiated = true;
}
const ngZone = new NgZone({ enableLongStackTrace: true });
const ngZoneInjector = ReflectiveInjector.resolveAndCreate([{ provide: NgZone, useValue: ngZone }], this.platform.injector);
this._moduleRef = this._moduleWithComponentFactories.ngModuleFactory.create(ngZoneInjector);
this._instantiated = true;
}
_createCompilerAndModule() {
const providers = this._providers.concat([{ provide: TestBed, useValue: this }]);
const declarations = this._declarations;
const imports = [this.ngModule, this._imports];
const schemas = this._schemas;
class DynamicTestModule {}
DynamicTestModule.decorators = [{ type: NgModule, args: [{ providers: providers, declarations: declarations, imports: imports, schemas: schemas }] }];
/** @nocollapse */
DynamicTestModule.ctorParameters = () => [];
const compilerFactory = this.platform.injector.get(TestingCompilerFactory);
this._compiler = compilerFactory.createTestingCompiler(this._compilerOptions.concat([{ useDebug: true }]));
this._moduleOverrides.forEach(entry => this._compiler.overrideModule(entry[0], entry[1]));
this._componentOverrides.forEach(entry => this._compiler.overrideComponent(entry[0], entry[1]));
this._directiveOverrides.forEach(entry => this._compiler.overrideDirective(entry[0], entry[1]));
this._pipeOverrides.forEach(entry => this._compiler.overridePipe(entry[0], entry[1]));
return DynamicTestModule;
}
_assertNotInstantiated(methodName, methodDescription) {
if (this._instantiated) {
throw new Error(`Cannot ${methodDescription} when the test module has already been instantiated. ` + `Make sure you are not using \`inject\` before \`${methodName}\`.`);
}, {
key: '_createCompilerAndModule',
value: function _createCompilerAndModule() {
var _this8 = this;
var providers = this._providers.concat([{ provide: TestBed, useValue: this }]);
var declarations = this._declarations;
var imports = [this.ngModule, this._imports];
var schemas = this._schemas;
var DynamicTestModule = function DynamicTestModule() {
_classCallCheck(this, DynamicTestModule);
};
DynamicTestModule.decorators = [{ type: NgModule, args: [{ providers: providers, declarations: declarations, imports: imports, schemas: schemas }] }];
/** @nocollapse */
DynamicTestModule.ctorParameters = function () {
return [];
};
var compilerFactory = this.platform.injector.get(TestingCompilerFactory);
this._compiler = compilerFactory.createTestingCompiler(this._compilerOptions.concat([{ useDebug: true }]));
this._moduleOverrides.forEach(function (entry) {
return _this8._compiler.overrideModule(entry[0], entry[1]);
});
this._componentOverrides.forEach(function (entry) {
return _this8._compiler.overrideComponent(entry[0], entry[1]);
});
this._directiveOverrides.forEach(function (entry) {
return _this8._compiler.overrideDirective(entry[0], entry[1]);
});
this._pipeOverrides.forEach(function (entry) {
return _this8._compiler.overridePipe(entry[0], entry[1]);
});
return DynamicTestModule;
}
}
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND) {
this._initIfNeeded();
if (token === TestBed) {
return this;
}, {
key: '_assertNotInstantiated',
value: function _assertNotInstantiated(methodName, methodDescription) {
if (this._instantiated) {
throw new Error('Cannot ' + methodDescription + ' when the test module has already been instantiated. ' + ('Make sure you are not using `inject` before `' + methodName + '`.'));
}
}
// Tests can inject things from the ng module and from the compiler,
// but the ng module can't inject things from the compiler and vice versa.
const result = this._moduleRef.injector.get(token, UNDEFINED);
return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue) : result;
}
execute(tokens, fn, context) {
this._initIfNeeded();
const params = tokens.map(t => this.get(t));
return fn.apply(context, params);
}
overrideModule(ngModule, override) {
this._assertNotInstantiated('overrideModule', 'override module metadata');
this._moduleOverrides.push([ngModule, override]);
}
overrideComponent(component, override) {
this._assertNotInstantiated('overrideComponent', 'override component metadata');
this._componentOverrides.push([component, override]);
}
overrideDirective(directive, override) {
this._assertNotInstantiated('overrideDirective', 'override directive metadata');
this._directiveOverrides.push([directive, override]);
}
overridePipe(pipe, override) {
this._assertNotInstantiated('overridePipe', 'override pipe metadata');
this._pipeOverrides.push([pipe, override]);
}
createComponent(component) {
this._initIfNeeded();
const componentFactory = this._moduleWithComponentFactories.componentFactories.find(compFactory => compFactory.componentType === component);
if (!componentFactory) {
throw new Error(`Cannot create the component ${stringify(component)} as it was not imported into the testing module!`);
}, {
key: 'get',
value: function get(token) {
var notFoundValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Injector.THROW_IF_NOT_FOUND;
this._initIfNeeded();
if (token === TestBed) {
return this;
}
// Tests can inject things from the ng module and from the compiler,
// but the ng module can't inject things from the compiler and vice versa.
var result = this._moduleRef.injector.get(token, UNDEFINED);
return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue) : result;
}
const noNgZone = this.get(ComponentFixtureNoNgZone, false);
const autoDetect = this.get(ComponentFixtureAutoDetect, false);
const ngZone = noNgZone ? null : this.get(NgZone, null);
const testComponentRenderer = this.get(TestComponentRenderer);
const rootElId = `root${_nextRootElementId++}`;
testComponentRenderer.insertRootElement(rootElId);
const initComponent = () => {
const componentRef = componentFactory.create(this, [], `#${rootElId}`);
return new ComponentFixture(componentRef, ngZone, autoDetect);
};
const fixture = !ngZone ? initComponent() : ngZone.run(initComponent);
this._activeFixtures.push(fixture);
return fixture;
}
}
let _testBed = null;
}, {
key: 'execute',
value: function execute(tokens, fn, context) {
var _this9 = this;
this._initIfNeeded();
var params = tokens.map(function (t) {
return _this9.get(t);
});
return fn.apply(context, params);
}
}, {
key: 'overrideModule',
value: function overrideModule(ngModule, override) {
this._assertNotInstantiated('overrideModule', 'override module metadata');
this._moduleOverrides.push([ngModule, override]);
}
}, {
key: 'overrideComponent',
value: function overrideComponent(component, override) {
this._assertNotInstantiated('overrideComponent', 'override component metadata');
this._componentOverrides.push([component, override]);
}
}, {
key: 'overrideDirective',
value: function overrideDirective(directive, override) {
this._assertNotInstantiated('overrideDirective', 'override directive metadata');
this._directiveOverrides.push([directive, override]);
}
}, {
key: 'overridePipe',
value: function overridePipe(pipe, override) {
this._assertNotInstantiated('overridePipe', 'override pipe metadata');
this._pipeOverrides.push([pipe, override]);
}
}, {
key: 'createComponent',
value: function createComponent(component) {
var _this10 = this;
this._initIfNeeded();
var componentFactory = this._moduleWithComponentFactories.componentFactories.find(function (compFactory) {
return compFactory.componentType === component;
});
if (!componentFactory) {
throw new Error('Cannot create the component ' + stringify(component) + ' as it was not imported into the testing module!');
}
var noNgZone = this.get(ComponentFixtureNoNgZone, false);
var autoDetect = this.get(ComponentFixtureAutoDetect, false);
var ngZone = noNgZone ? null : this.get(NgZone, null);
var testComponentRenderer = this.get(TestComponentRenderer);
var rootElId = 'root' + _nextRootElementId++;
testComponentRenderer.insertRootElement(rootElId);
var initComponent = function initComponent() {
var componentRef = componentFactory.create(_this10, [], '#' + rootElId);
return new ComponentFixture(componentRef, ngZone, autoDetect);
};
var fixture = !ngZone ? initComponent() : ngZone.run(initComponent);
this._activeFixtures.push(fixture);
return fixture;
}
}], [{
key: 'initTestEnvironment',
value: function initTestEnvironment(ngModule, platform) {
var testBed = getTestBed();
testBed.initTestEnvironment(ngModule, platform);
return testBed;
}
/**
* Reset the providers for the test injector.
*
* @experimental
*/
}, {
key: 'resetTestEnvironment',
value: function resetTestEnvironment() {
getTestBed().resetTestEnvironment();
}
}, {
key: 'resetTestingModule',
value: function resetTestingModule() {
getTestBed().resetTestingModule();
return TestBed;
}
/**
* Allows overriding default compiler providers and settings
* which are defined in test_injector.js
*/
}, {
key: 'configureCompiler',
value: function configureCompiler(config) {
getTestBed().configureCompiler(config);
return TestBed;
}
/**
* Allows overriding default providers, directives, pipes, modules of the test injector,
* which are defined in test_injector.js
*/
}, {
key: 'configureTestingModule',
value: function configureTestingModule(moduleDef) {
getTestBed().configureTestingModule(moduleDef);
return TestBed;
}
/**
* Compile components with a `templateUrl` for the test's NgModule.
* It is necessary to call this function
* as fetching urls is asynchronous.
*/
}, {
key: 'compileComponents',
value: function compileComponents() {
return getTestBed().compileComponents();
}
}, {
key: 'overrideModule',
value: function overrideModule(ngModule, override) {
getTestBed().overrideModule(ngModule, override);
return TestBed;
}
}, {
key: 'overrideComponent',
value: function overrideComponent(component, override) {
getTestBed().overrideComponent(component, override);
return TestBed;
}
}, {
key: 'overrideDirective',
value: function overrideDirective(directive, override) {
getTestBed().overrideDirective(directive, override);
return TestBed;
}
}, {
key: 'overridePipe',
value: function overridePipe(pipe, override) {
getTestBed().overridePipe(pipe, override);
return TestBed;
}
}, {
key: 'overrideTemplate',
value: function overrideTemplate(component, template) {
getTestBed().overrideComponent(component, { set: { template: template, templateUrl: null } });
return TestBed;
}
}, {
key: 'get',
value: function get(token) {
var notFoundValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Injector.THROW_IF_NOT_FOUND;
return getTestBed().get(token, notFoundValue);
}
}, {
key: 'createComponent',
value: function createComponent(component) {
return getTestBed().createComponent(component);
}
}]);
return TestBed;
}();
var _testBed = null;
/**

@@ -810,12 +1032,14 @@ * @experimental

*/
function inject(tokens, fn) {
const testBed = getTestBed();
function _inject(tokens, fn) {
var testBed = getTestBed();
if (tokens.indexOf(AsyncTestCompleter) >= 0) {
// Not using an arrow function to preserve context passed from call site
return function () {
var _this11 = this;
// Return an async test method that returns a Promise if AsyncTestCompleter is one of
// the injected tokens.
return testBed.compileComponents().then(() => {
const completer = testBed.get(AsyncTestCompleter);
testBed.execute(tokens, fn, this);
return testBed.compileComponents().then(function () {
var completer = testBed.get(AsyncTestCompleter);
testBed.execute(tokens, fn, _this11);
return completer.promise;

@@ -834,26 +1058,40 @@ });

*/
class InjectSetupWrapper {
constructor(_moduleDef) {
var InjectSetupWrapper = function () {
function InjectSetupWrapper(_moduleDef) {
_classCallCheck(this, InjectSetupWrapper);
this._moduleDef = _moduleDef;
}
_addModule() {
const moduleDef = this._moduleDef();
if (moduleDef) {
getTestBed().configureTestingModule(moduleDef);
_createClass(InjectSetupWrapper, [{
key: '_addModule',
value: function _addModule() {
var moduleDef = this._moduleDef();
if (moduleDef) {
getTestBed().configureTestingModule(moduleDef);
}
}
}
inject(tokens, fn) {
const self = this;
// Not using an arrow function to preserve context passed from call site
return function () {
self._addModule();
return inject(tokens, fn).call(this);
};
}
}
function withModule(moduleDef, fn = null) {
}, {
key: 'inject',
value: function inject(tokens, fn) {
var self = this;
// Not using an arrow function to preserve context passed from call site
return function () {
self._addModule();
return _inject(tokens, fn).call(this);
};
}
}]);
return InjectSetupWrapper;
}();
function withModule(moduleDef) {
var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
if (fn) {
// Not using an arrow function to preserve context passed from call site
return function () {
const testBed = getTestBed();
var testBed = getTestBed();
if (moduleDef) {

@@ -865,3 +1103,5 @@ testBed.configureTestingModule(moduleDef);

}
return new InjectSetupWrapper(() => moduleDef);
return new InjectSetupWrapper(function () {
return moduleDef;
});
}

@@ -872,6 +1112,6 @@ function getComponentType(error) {

const _global$2 = typeof window === 'undefined' ? global : window;
var _global$2 = typeof window === 'undefined' ? global : window;
// Reset the test providers and the fake async zone before each test.
if (_global$2.beforeEach) {
_global$2.beforeEach(() => {
_global$2.beforeEach(function () {
TestBed.resetTestingModule();

@@ -883,107 +1123,4 @@ resetFakeAsyncZone();

// work.
const __core_private_testing_placeholder__ = '';
var __core_private_testing_placeholder__ = '';
class MockAnimationPlayer {
constructor(startingStyles = {}, keyframes = [], previousPlayers = []) {
this.startingStyles = startingStyles;
this.keyframes = keyframes;
this._onDoneFns = [];
this._onStartFns = [];
this._onDestroyFns = [];
this._finished = false;
this._destroyed = false;
this._started = false;
this.parentPlayer = null;
this.previousStyles = {};
this.log = [];
previousPlayers.forEach(player => {
if (player instanceof MockAnimationPlayer) {
const styles = player._captureStyles();
Object.keys(styles).forEach(prop => this.previousStyles[prop] = styles[prop]);
}
});
}
_onFinish() {
if (!this._finished) {
this._finished = true;
this.log.push('finish');
this._onDoneFns.forEach(fn => fn());
this._onDoneFns = [];
}
}
init() {
this.log.push('init');
}
onDone(fn) {
this._onDoneFns.push(fn);
}
onStart(fn) {
this._onStartFns.push(fn);
}
onDestroy(fn) {
this._onDestroyFns.push(fn);
}
hasStarted() {
return this._started;
}
play() {
if (!this.hasStarted()) {
this._onStartFns.forEach(fn => fn());
this._onStartFns = [];
this._started = true;
}
this.log.push('play');
}
pause() {
this.log.push('pause');
}
restart() {
this.log.push('restart');
}
finish() {
this._onFinish();
}
reset() {
this.log.push('reset');
this._destroyed = false;
this._finished = false;
this._started = false;
}
destroy() {
if (!this._destroyed) {
this._destroyed = true;
this.finish();
this.log.push('destroy');
this._onDestroyFns.forEach(fn => fn());
this._onDestroyFns = [];
}
}
setPosition(p) {}
getPosition() {
return 0;
}
_captureStyles() {
const captures = {};
if (this.hasStarted()) {
// when assembling the captured styles, it's important that
// we build the keyframe styles in the following order:
// {startingStyles, ... other styles within keyframes, ... previousStyles }
Object.keys(this.startingStyles).forEach(prop => {
captures[prop] = this.startingStyles[prop];
});
this.keyframes.forEach(kf => {
const [offset, styles] = kf;
const newStyles = {};
Object.keys(styles).forEach(prop => {
captures[prop] = this._finished ? styles[prop] : AUTO_STYLE;
});
});
}
Object.keys(this.previousStyles).forEach(prop => {
captures[prop] = this.previousStyles[prop];
});
return captures;
}
}
export { async, ComponentFixture, resetFakeAsyncZone, fakeAsync, tick, discardPeriodicTasks, flushMicrotasks, TestComponentRenderer, ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestBed, getTestBed, inject, InjectSetupWrapper, withModule, __core_private_testing_placeholder__, MockAnimationPlayer as ɵMockAnimationPlayer, TestingCompiler as ɵTestingCompiler, TestingCompilerFactory as ɵTestingCompilerFactory };
export { async, ComponentFixture, resetFakeAsyncZone, fakeAsync, tick, discardPeriodicTasks, flushMicrotasks, TestComponentRenderer, ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestBed, getTestBed, _inject as inject, InjectSetupWrapper, withModule, __core_private_testing_placeholder__, TestingCompiler as ɵTestingCompiler, TestingCompilerFactory as ɵTestingCompilerFactory };

@@ -1,2 +0,2 @@

import { getDebugNode, InjectionToken, NgZone, Injector, NgModule, ReflectiveInjector, ɵERROR_COMPONENT_TYPE, Compiler, AUTO_STYLE } from '@angular/core';
import { getDebugNode, InjectionToken, NgZone, Injector, NgModule, ReflectiveInjector, ɵERROR_COMPONENT_TYPE, Compiler } from '@angular/core';

@@ -851,85 +851,2 @@ /**

class MockAnimationPlayer {
constructor(startingStyles = {}, keyframes = [], previousPlayers = []) {
this.startingStyles = startingStyles;
this.keyframes = keyframes;
this._onDoneFns = [];
this._onStartFns = [];
this._onDestroyFns = [];
this._finished = false;
this._destroyed = false;
this._started = false;
this.parentPlayer = null;
this.previousStyles = {};
this.log = [];
previousPlayers.forEach(player => {
if (player instanceof MockAnimationPlayer) {
const styles = player._captureStyles();
Object.keys(styles).forEach(prop => this.previousStyles[prop] = styles[prop]);
}
});
}
_onFinish() {
if (!this._finished) {
this._finished = true;
this.log.push('finish');
this._onDoneFns.forEach(fn => fn());
this._onDoneFns = [];
}
}
init() { this.log.push('init'); }
onDone(fn) { this._onDoneFns.push(fn); }
onStart(fn) { this._onStartFns.push(fn); }
onDestroy(fn) { this._onDestroyFns.push(fn); }
hasStarted() { return this._started; }
play() {
if (!this.hasStarted()) {
this._onStartFns.forEach(fn => fn());
this._onStartFns = [];
this._started = true;
}
this.log.push('play');
}
pause() { this.log.push('pause'); }
restart() { this.log.push('restart'); }
finish() { this._onFinish(); }
reset() {
this.log.push('reset');
this._destroyed = false;
this._finished = false;
this._started = false;
}
destroy() {
if (!this._destroyed) {
this._destroyed = true;
this.finish();
this.log.push('destroy');
this._onDestroyFns.forEach(fn => fn());
this._onDestroyFns = [];
}
}
setPosition(p) { }
getPosition() { return 0; }
_captureStyles() {
const captures = {};
if (this.hasStarted()) {
// when assembling the captured styles, it's important that
// we build the keyframe styles in the following order:
// {startingStyles, ... other styles within keyframes, ... previousStyles }
Object.keys(this.startingStyles).forEach(prop => {
captures[prop] = this.startingStyles[prop];
});
this.keyframes.forEach(kf => {
const [offset, styles] = kf;
const newStyles = {};
Object.keys(styles).forEach(prop => { captures[prop] = this._finished ? styles[prop] : AUTO_STYLE; });
});
}
Object.keys(this.previousStyles).forEach(prop => {
captures[prop] = this.previousStyles[prop];
});
return captures;
}
}
export { async, ComponentFixture, resetFakeAsyncZone, fakeAsync, tick, discardPeriodicTasks, flushMicrotasks, TestComponentRenderer, ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestBed, getTestBed, inject, InjectSetupWrapper, withModule, __core_private_testing_placeholder__, MockAnimationPlayer as ɵMockAnimationPlayer, TestingCompiler as ɵTestingCompiler, TestingCompilerFactory as ɵTestingCompilerFactory };
export { async, ComponentFixture, resetFakeAsyncZone, fakeAsync, tick, discardPeriodicTasks, flushMicrotasks, TestComponentRenderer, ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestBed, getTestBed, inject, InjectSetupWrapper, withModule, __core_private_testing_placeholder__, TestingCompiler as ɵTestingCompiler, TestingCompilerFactory as ɵTestingCompilerFactory };
/**
* @license Angular v4.0.0-rc.1
* @license Angular v4.0.0-rc.2
* (c) 2010-2017 Google, Inc. https://angular.io/

@@ -26,42 +26,4 @@ * License: MIT

});
exports.ɵTestingCompilerFactory = exports.ɵTestingCompiler = exports.ɵMockAnimationPlayer = exports.__core_private_testing_placeholder__ = exports.withModule = exports.InjectSetupWrapper = exports.inject = exports.getTestBed = exports.TestBed = exports.ComponentFixtureNoNgZone = exports.ComponentFixtureAutoDetect = exports.TestComponentRenderer = exports.flushMicrotasks = exports.discardPeriodicTasks = exports.tick = exports.fakeAsync = exports.resetFakeAsyncZone = exports.ComponentFixture = exports.async = undefined;
exports.ɵTestingCompilerFactory = exports.ɵTestingCompiler = exports.__core_private_testing_placeholder__ = exports.withModule = exports.InjectSetupWrapper = exports.inject = exports.getTestBed = exports.TestBed = exports.ComponentFixtureNoNgZone = exports.ComponentFixtureAutoDetect = exports.TestComponentRenderer = exports.flushMicrotasks = exports.discardPeriodicTasks = exports.tick = exports.fakeAsync = exports.resetFakeAsyncZone = exports.ComponentFixture = exports.async = undefined;
var _slicedToArray = function () {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
}();
function _toConsumableArray(arr) {

@@ -1128,161 +1090,2 @@ if (Array.isArray(arr)) {

var MockAnimationPlayer = function () {
function MockAnimationPlayer() {
var startingStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _this12 = this;
var keyframes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var previousPlayers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
_classCallCheck(this, MockAnimationPlayer);
this.startingStyles = startingStyles;
this.keyframes = keyframes;
this._onDoneFns = [];
this._onStartFns = [];
this._onDestroyFns = [];
this._finished = false;
this._destroyed = false;
this._started = false;
this.parentPlayer = null;
this.previousStyles = {};
this.log = [];
previousPlayers.forEach(function (player) {
if (player instanceof MockAnimationPlayer) {
var styles = player._captureStyles();
Object.keys(styles).forEach(function (prop) {
return _this12.previousStyles[prop] = styles[prop];
});
}
});
}
_createClass(MockAnimationPlayer, [{
key: '_onFinish',
value: function _onFinish() {
if (!this._finished) {
this._finished = true;
this.log.push('finish');
this._onDoneFns.forEach(function (fn) {
return fn();
});
this._onDoneFns = [];
}
}
}, {
key: 'init',
value: function init() {
this.log.push('init');
}
}, {
key: 'onDone',
value: function onDone(fn) {
this._onDoneFns.push(fn);
}
}, {
key: 'onStart',
value: function onStart(fn) {
this._onStartFns.push(fn);
}
}, {
key: 'onDestroy',
value: function onDestroy(fn) {
this._onDestroyFns.push(fn);
}
}, {
key: 'hasStarted',
value: function hasStarted() {
return this._started;
}
}, {
key: 'play',
value: function play() {
if (!this.hasStarted()) {
this._onStartFns.forEach(function (fn) {
return fn();
});
this._onStartFns = [];
this._started = true;
}
this.log.push('play');
}
}, {
key: 'pause',
value: function pause() {
this.log.push('pause');
}
}, {
key: 'restart',
value: function restart() {
this.log.push('restart');
}
}, {
key: 'finish',
value: function finish() {
this._onFinish();
}
}, {
key: 'reset',
value: function reset() {
this.log.push('reset');
this._destroyed = false;
this._finished = false;
this._started = false;
}
}, {
key: 'destroy',
value: function destroy() {
if (!this._destroyed) {
this._destroyed = true;
this.finish();
this.log.push('destroy');
this._onDestroyFns.forEach(function (fn) {
return fn();
});
this._onDestroyFns = [];
}
}
}, {
key: 'setPosition',
value: function setPosition(p) {}
}, {
key: 'getPosition',
value: function getPosition() {
return 0;
}
}, {
key: '_captureStyles',
value: function _captureStyles() {
var _this13 = this;
var captures = {};
if (this.hasStarted()) {
// when assembling the captured styles, it's important that
// we build the keyframe styles in the following order:
// {startingStyles, ... other styles within keyframes, ... previousStyles }
Object.keys(this.startingStyles).forEach(function (prop) {
captures[prop] = _this13.startingStyles[prop];
});
this.keyframes.forEach(function (kf) {
var _kf = _slicedToArray(kf, 2),
offset = _kf[0],
styles = _kf[1];
var newStyles = {};
Object.keys(styles).forEach(function (prop) {
captures[prop] = _this13._finished ? styles[prop] : _core.AUTO_STYLE;
});
});
}
Object.keys(this.previousStyles).forEach(function (prop) {
captures[prop] = _this13.previousStyles[prop];
});
return captures;
}
}]);
return MockAnimationPlayer;
}();
exports.async = async;

@@ -1304,5 +1107,4 @@ exports.ComponentFixture = ComponentFixture;

exports.__core_private_testing_placeholder__ = __core_private_testing_placeholder__;
exports.ɵMockAnimationPlayer = MockAnimationPlayer;
exports.ɵTestingCompiler = TestingCompiler;
exports.ɵTestingCompilerFactory = TestingCompilerFactory;
});
{
"name": "@angular/core",
"version": "4.0.0-rc.1",
"version": "4.0.0-rc.2",
"description": "Angular - the core framework",

@@ -5,0 +5,0 @@ "main": "./bundles/core.umd.js",

@@ -5,4 +5,3 @@ /**

export * from './public_api';
export { AnimationQueue as ɵz } from './src/animation/animation_queue';
export { AnimationMetadataType as ɵba, animate as ɵbc, group as ɵbd, keyframes as ɵbh, sequence as ɵbe, state as ɵbg, style as ɵbf, transition as ɵbi, trigger as ɵbb } from './src/animation_next/dsl';
export { AnimationMetadataType as ɵy, animate as ɵba, group as ɵbb, keyframes as ɵbf, sequence as ɵbc, state as ɵbe, style as ɵbd, transition as ɵbg, trigger as ɵz } from './src/animation/dsl';
export { _initViewEngine as ɵp, _iterableDiffersFactory as ɵm, _keyValueDiffersFactory as ɵn, _localeFactory as ɵo } from './src/application_module';

@@ -22,2 +21,1 @@ export { ApplicationRef_ as ɵf } from './src/application_ref';

export { _def as ɵx } from './src/view/provider';
export { NodeType as ɵy } from './src/view/types';

@@ -18,3 +18,2 @@ /**

import { ViewRef } from './linker/view_ref';
import { Testability, TestabilityRegistry } from './testability/testability';
import { Type } from './type';

@@ -241,4 +240,2 @@ import { NgZone } from './zone/ng_zone';

private _initStatus;
private _testabilityRegistry;
private _testability;
private _bootstrapListeners;

@@ -252,3 +249,3 @@ private _rootComponents;

private _stable;
constructor(_zone: NgZone, _console: Console, _injector: Injector, _exceptionHandler: ErrorHandler, _componentFactoryResolver: ComponentFactoryResolver, _initStatus: ApplicationInitStatus, _testabilityRegistry: TestabilityRegistry, _testability: Testability);
constructor(_zone: NgZone, _console: Console, _injector: Injector, _exceptionHandler: ErrorHandler, _componentFactoryResolver: ComponentFactoryResolver, _initStatus: ApplicationInitStatus);
attachView(viewRef: ViewRef): void;

@@ -255,0 +252,0 @@ detachView(viewRef: ViewRef): void;

@@ -8,22 +8,6 @@ /**

*/
export { AnimationGroupPlayer as ɵAnimationGroupPlayer } from './animation/animation_group_player';
export { AnimationKeyframe as ɵAnimationKeyframe } from './animation/animation_keyframe';
export { NoOpAnimationPlayer as ɵNoOpAnimationPlayer } from './animation/animation_player';
export { AnimationSequencePlayer as ɵAnimationSequencePlayer } from './animation/animation_sequence_player';
export { balanceAnimationKeyframes as ɵbalanceAnimationKeyframes, clearStyles as ɵclearStyles, collectAndResolveStyles as ɵcollectAndResolveStyles, prepareFinalAnimationStyles as ɵprepareFinalAnimationStyles, renderStyles as ɵrenderStyles } from './animation/animation_style_util';
export { AnimationStyles as ɵAnimationStyles } from './animation/animation_styles';
export { AnimationTransition as ɵAnimationTransition } from './animation/animation_transition';
export { ValueUnwrapper as ɵValueUnwrapper, devModeEqual as ɵdevModeEqual } from './change_detection/change_detection_util';
export { ChangeDetectorStatus as ɵChangeDetectorStatus } from './change_detection/constants';
export { ComponentRef_ as ɵComponentRef_ } from './linker/component_factory';
export { CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver } from './linker/component_factory_resolver';
export { DebugContext as ɵDebugContext, StaticNodeDebugInfo as ɵStaticNodeDebugInfo } from './linker/debug_context';
export { NgModuleInjector as ɵNgModuleInjector } from './linker/ng_module_factory';
export { registerModuleFactory as ɵregisterModuleFactory } from './linker/ng_module_factory_loader';
export { TemplateRef_ as ɵTemplateRef_ } from './linker/template_ref';
export { AppView as ɵAppView, DebugAppView as ɵDebugAppView } from './linker/view';
export { ViewContainer as ɵViewContainer } from './linker/view_container';
export { ViewType as ɵViewType } from './linker/view_type';
export { EMPTY_ARRAY as ɵEMPTY_ARRAY, EMPTY_INLINE_ARRAY as ɵEMPTY_INLINE_ARRAY, EMPTY_MAP as ɵEMPTY_MAP, InlineArray16 as ɵInlineArray16, InlineArray2 as ɵInlineArray2, InlineArray4 as ɵInlineArray4, InlineArray8 as ɵInlineArray8, InlineArrayDynamic as ɵInlineArrayDynamic, ViewUtils as ɵViewUtils, castByValue as ɵcastByValue, checkBinding as ɵcheckBinding, checkBindingChange as ɵcheckBindingChange, checkRenderAttribute as ɵcheckRenderAttribute, checkRenderClass as ɵcheckRenderClass, checkRenderProperty as ɵcheckRenderProperty, checkRenderStyle as ɵcheckRenderStyle, checkRenderText as ɵcheckRenderText, createRenderComponentType as ɵcreateRenderComponentType, createRenderElement as ɵcreateRenderElement, getComponentFactoryViewClass as ɵgetComponentFactoryViewClass, inlineInterpolate as ɵinlineInterpolate, interpolate as ɵinterpolate, noop as ɵnoop, pureProxy1 as ɵpureProxy1, pureProxy10 as ɵpureProxy10, pureProxy2 as ɵpureProxy2, pureProxy3 as ɵpureProxy3, pureProxy4 as ɵpureProxy4, pureProxy5 as ɵpureProxy5, pureProxy6 as ɵpureProxy6, pureProxy7 as ɵpureProxy7, pureProxy8 as ɵpureProxy8, pureProxy9 as ɵpureProxy9, selectOrCreateRenderHostElement as ɵselectOrCreateRenderHostElement, setBindingDebugInfo as ɵsetBindingDebugInfo, setBindingDebugInfoForChanges as ɵsetBindingDebugInfoForChanges, subscribeToRenderElement as ɵsubscribeToRenderElement } from './linker/view_utils';
export { reflector as ɵreflector } from './reflection/reflection';
export { ArgumentType as ɵArgumentType, BindingType as ɵBindingType, DepFlags as ɵDepFlags, NodeFlags as ɵNodeFlags, ProviderType as ɵProviderType, QueryBindingType as ɵQueryBindingType, QueryValueType as ɵQueryValueType, ViewDefinition as ɵViewDefinition, ViewFlags as ɵViewFlags, anchorDef as ɵanchorDef, createComponentFactory as ɵcreateComponentFactory, createRendererTypeV2 as ɵcreateRendererTypeV2, directiveDef as ɵdirectiveDef, elementDef as ɵelementDef, elementEventFullName as ɵelementEventFullName, ngContentDef as ɵngContentDef, nodeValue as ɵnodeValue, pipeDef as ɵpipeDef, providerDef as ɵproviderDef, pureArrayDef as ɵpureArrayDef, pureObjectDef as ɵpureObjectDef, purePipeDef as ɵpurePipeDef, queryDef as ɵqueryDef, textDef as ɵtextDef, unwrapValue as ɵunwrapValue, viewDef as ɵviewDef } from './view/index';
export { ArgumentType as ɵArgumentType, BindingType as ɵBindingType, DepFlags as ɵDepFlags, EMPTY_ARRAY as ɵEMPTY_ARRAY, EMPTY_MAP as ɵEMPTY_MAP, NodeFlags as ɵNodeFlags, QueryBindingType as ɵQueryBindingType, QueryValueType as ɵQueryValueType, ViewDefinition as ɵViewDefinition, ViewFlags as ɵViewFlags, anchorDef as ɵand, createComponentFactory as ɵccf, createRendererTypeV2 as ɵcrt, directiveDef as ɵdid, elementDef as ɵeld, elementEventFullName as ɵelementEventFullName, getComponentViewDefinitionFactory as ɵgetComponentViewDefinitionFactory, inlineInterpolate as ɵinlineInterpolate, interpolate as ɵinterpolate, ngContentDef as ɵncd, nodeValue as ɵnov, pipeDef as ɵpid, providerDef as ɵprd, pureArrayDef as ɵpad, pureObjectDef as ɵpod, purePipeDef as ɵppd, queryDef as ɵqud, textDef as ɵted, unwrapValue as ɵunv, viewDef as ɵvid } from './view/index';

@@ -8,10 +8,2 @@ /**

*/
export { ANY_STATE as ɵANY_STATE, DEFAULT_STATE as ɵDEFAULT_STATE, EMPTY_STATE as ɵEMPTY_STATE, FILL_STYLE_FLAG as ɵFILL_STYLE_FLAG } from './animation/animation_constants';
export { AnimationGroupPlayer as ɵAnimationGroupPlayer } from './animation/animation_group_player';
export { AnimationKeyframe as ɵAnimationKeyframe } from './animation/animation_keyframe';
export { AnimationPlayer as ɵAnimationPlayer, NoOpAnimationPlayer as ɵNoOpAnimationPlayer } from './animation/animation_player';
export { AnimationSequencePlayer as ɵAnimationSequencePlayer } from './animation/animation_sequence_player';
export { balanceAnimationKeyframes as ɵbalanceAnimationKeyframes, clearStyles as ɵclearStyles, collectAndResolveStyles as ɵcollectAndResolveStyles, flattenStyles as ɵflattenStyles, prepareFinalAnimationStyles as ɵprepareFinalAnimationStyles, renderStyles as ɵrenderStyles } from './animation/animation_style_util';
export { AnimationStyles as ɵAnimationStyles } from './animation/animation_styles';
export { AnimationTransition as ɵAnimationTransition } from './animation/animation_transition';
export { ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS } from './application_ref';

@@ -22,10 +14,5 @@ export { APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER } from './application_tokens';

export { Console as ɵConsole } from './console';
export { DebugDomRootRenderer as ɵDebugDomRootRenderer } from './debug/debug_renderer';
export { ERROR_COMPONENT_TYPE as ɵERROR_COMPONENT_TYPE } from './errors';
export { ComponentFactory as ɵComponentFactory } from './linker/component_factory';
export { CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver } from './linker/component_factory_resolver';
export { DebugContext as ɵDebugContext, StaticNodeDebugInfo as ɵStaticNodeDebugInfo } from './linker/debug_context';
export { AppView as ɵAppView, DebugAppView as ɵDebugAppView } from './linker/view';
export { ViewContainer as ɵViewContainer } from './linker/view_container';
export { ViewType as ɵViewType } from './linker/view_type';
export { LIFECYCLE_HOOKS_VALUES as ɵLIFECYCLE_HOOKS_VALUES, LifecycleHooks as ɵLifecycleHooks } from './metadata/lifecycle_hooks';

@@ -32,0 +19,0 @@ export { ViewMetadata as ɵViewMetadata } from './metadata/view';

@@ -34,15 +34,24 @@ /**

export * from './core_private_export';
export { AnimationPlayer } from './animation/animation_player';
export { AnimationStyles } from './animation/animation_styles';
export { AnimationKeyframe } from './animation/animation_keyframe';
export { Sanitizer, SecurityContext } from './security';
export * from './codegen_private_exports';
export * from './animation_next/animation_metadata_wrapped';
export * from './animation/animation_metadata_wrapped';
/**
* @deprecated
* @deprecated from v4
*/
export declare type AnimationEntryMetadata = any;
/**
* @deprecated
* @deprecated from v4
*/
export declare type AnimationStateTransitionMetadata = any;
/**
* @deprecated from v4
*/
export declare type AnimationPlayer = any;
/**
* @deprecated from v4
*/
export declare type AnimationStyles = any;
/**
* @deprecated from v4
*/
export declare type AnimationKeyframe = any;

@@ -12,3 +12,2 @@ /**

import { ElementRef } from './element_ref';
import { AppView } from './view';
import { ViewRef } from './view_ref';

@@ -58,31 +57,11 @@ /**

/**
* workaround https://github.com/angular/tsickle/issues/350
* @suppress {checkTypes}
*/
export declare class ComponentRef_<C> extends ComponentRef<C> {
private _index;
private _parentView;
private _nativeElement;
private _component;
constructor(_index: number, _parentView: AppView<any>, _nativeElement: any, _component: C);
readonly location: ElementRef;
readonly injector: Injector;
readonly instance: C;
readonly hostView: ViewRef;
readonly changeDetectorRef: ChangeDetectorRef;
readonly componentType: Type<any>;
destroy(): void;
onDestroy(callback: Function): void;
}
/**
* @stable
*/
export declare class ComponentFactory<C> {
selector: string;
componentType: Type<any>;
constructor(selector: string, _viewClass: Type<AppView<any>>, componentType: Type<any>);
export declare abstract class ComponentFactory<C> {
readonly abstract selector: string;
readonly abstract componentType: Type<any>;
/**
* Creates a new component.
*/
create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any): ComponentRef<C>;
abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any): ComponentRef<C>;
}

@@ -9,3 +9,2 @@ /**

import { ElementRef } from './element_ref';
import { AppView } from './view';
import { EmbeddedViewRef } from './view_ref';

@@ -40,13 +39,1 @@ /**

}
/**
* workaround https://github.com/angular/tsickle/issues/350
* @suppress {checkTypes}
*/
export declare class TemplateRef_<C> extends TemplateRef<C> {
private _parentView;
private _nodeIndex;
private _nativeElement;
constructor(_parentView: AppView<any>, _nodeIndex: number, _nativeElement: any);
createEmbeddedView(context: C): EmbeddedViewRef<C>;
readonly elementRef: ElementRef;
}

@@ -12,3 +12,2 @@ /**

import { TemplateRef } from './template_ref';
import { ViewContainer } from './view_container';
import { EmbeddedViewRef, ViewRef } from './view_ref';

@@ -108,18 +107,1 @@ /**

}
export declare class ViewContainerRef_ implements ViewContainerRef {
private _element;
constructor(_element: ViewContainer);
get(index: number): ViewRef;
readonly length: number;
readonly element: ElementRef;
readonly injector: Injector;
readonly parentInjector: Injector;
createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][]): ComponentRef<C>;
insert(viewRef: ViewRef, index?: number): ViewRef;
move(viewRef: ViewRef, currentIndex: number): ViewRef;
indexOf(viewRef: ViewRef): number;
remove(index?: number): void;
detach(index?: number): ViewRef;
clear(): void;
}

@@ -8,6 +8,4 @@ /**

*/
import { AnimationQueue } from '../animation/animation_queue';
import { ApplicationRef } from '../application_ref';
import { ChangeDetectorRef } from '../change_detection/change_detector_ref';
import { AppView } from './view';
/**

@@ -86,19 +84,1 @@ * @stable

}
export declare class ViewRef_<C> implements EmbeddedViewRef<C>, ChangeDetectorRef, InternalViewRef {
private _view;
animationQueue: AnimationQueue;
constructor(_view: AppView<C>, animationQueue: AnimationQueue);
readonly internalView: AppView<C>;
readonly rootNodes: any[];
readonly context: C;
readonly destroyed: boolean;
markForCheck(): void;
detach(): void;
detectChanges(): void;
checkNoChanges(): void;
reattach(): void;
onDestroy(callback: Function): void;
destroy(): void;
detachFromAppRef(): void;
attachToAppRef(appRef: ApplicationRef): void;
}

@@ -8,3 +8,2 @@ /**

*/
import { AnimationEntryMetadata } from '../animation/metadata';
import { ChangeDetectionStrategy } from '../change_detection/constants';

@@ -629,3 +628,3 @@ import { Provider } from '../di';

*/
animations?: AnimationEntryMetadata[];
animations?: any[];
/**

@@ -632,0 +631,0 @@ * Specifies how the template and the styles should be encapsulated:

@@ -8,3 +8,2 @@ /**

*/
import { AnimationEntryMetadata } from '../animation/metadata';
/**

@@ -75,3 +74,3 @@ * Defines template and style encapsulation options available for Component's {@link Component}.

/** {@link Component.animation} */
animations: AnimationEntryMetadata[];
animations: any[];
/** {@link Component.interpolation} */

@@ -85,5 +84,5 @@ interpolation: [string, string];

styleUrls?: string[];
animations?: AnimationEntryMetadata[];
animations?: any[];
interpolation?: [string, string];
});
}

@@ -8,5 +8,2 @@ /**

*/
import { AnimationKeyframe } from '../../src/animation/animation_keyframe';
import { AnimationPlayer } from '../../src/animation/animation_player';
import { AnimationStyles } from '../../src/animation/animation_styles';
import { InjectionToken, Injector } from '../di';

@@ -74,3 +71,3 @@ import { ViewEncapsulation } from '../metadata/view';

abstract setText(renderNode: any, text: string): void;
abstract animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string, previousPlayers?: AnimationPlayer[]): AnimationPlayer;
abstract animate(element: any, startingStyles: any, keyframes: any[], duration: number, delay: number, easing: string, previousPlayers?: any[]): any;
}

@@ -77,0 +74,0 @@ export declare const RendererV2Interceptor: InjectionToken<RendererV2[]>;

@@ -13,8 +13,8 @@ /**

export { queryDef } from './query';
export { ViewRef_, createComponentFactory, nodeValue } from './refs';
export { ViewRef_, createComponentFactory, getComponentViewDefinitionFactory, nodeValue } from './refs';
export { initServicesIfNeeded } from './services';
export { textDef } from './text';
export { createRendererTypeV2, elementEventFullName, rootRenderNodes, unwrapValue } from './util';
export { EMPTY_ARRAY, EMPTY_MAP, createRendererTypeV2, elementEventFullName, inlineInterpolate, interpolate, rootRenderNodes, unwrapValue } from './util';
export { viewDef } from './view';
export { attachEmbeddedView, detachEmbeddedView, moveEmbeddedView } from './view_attach';
export * from './types';

@@ -1,2 +0,2 @@

import { BindingDef, DepDef, DepFlags, NodeDef, NodeFlags, NodeType, OutputDef, ProviderType, QueryValueType, ViewData } from './types';
import { BindingDef, DepDef, DepFlags, NodeDef, NodeFlags, OutputDef, QueryValueType, ViewData } from './types';
export declare function directiveDef(flags: NodeFlags, matchedQueries: [string | number, QueryValueType][], childCount: number, ctor: any, deps: ([DepFlags, any] | any)[], props?: {

@@ -8,4 +8,4 @@ [name: string]: [number, string];

export declare function pipeDef(flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef;
export declare function providerDef(flags: NodeFlags, matchedQueries: [string | number, QueryValueType][], type: ProviderType, token: any, value: any, deps: ([DepFlags, any] | any)[]): NodeDef;
export declare function _def(type: NodeType, flags: NodeFlags, matchedQueriesDsl: [string | number, QueryValueType][], childCount: number, providerType: ProviderType, token: any, value: any, deps: ([DepFlags, any] | any)[], bindings?: BindingDef[], outputs?: OutputDef[]): NodeDef;
export declare function providerDef(flags: NodeFlags, matchedQueries: [string | number, QueryValueType][], token: any, value: any, deps: ([DepFlags, any] | any)[]): NodeDef;
export declare function _def(flags: NodeFlags, matchedQueriesDsl: [string | number, QueryValueType][], childCount: number, token: any, value: any, deps: ([DepFlags, any] | any)[], bindings?: BindingDef[], outputs?: OutputDef[]): NodeDef;
export declare function createProviderInstance(view: ViewData, def: NodeDef): any;

@@ -12,0 +12,0 @@ export declare function createPipeInstance(view: ViewData, def: NodeDef): any;

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ApplicationRef } from '../application_ref';

@@ -12,2 +19,3 @@ import { ChangeDetectorRef } from '../change_detection/change_detection';

export declare function createComponentFactory(selector: string, componentType: Type<any>, viewDefFactory: ViewDefinitionFactory): ComponentFactory<any>;
export declare function getComponentViewDefinitionFactory(componentFactory: ComponentFactory<any>): ViewDefinitionFactory;
export declare function createViewContainerRef(view: ViewData, elDef: NodeDef): ViewContainerRef;

@@ -14,0 +22,0 @@ export declare function createChangeDetectorRef(view: ViewData): ChangeDetectorRef;

@@ -17,7 +17,3 @@ import { Injector } from '../di';

nodeFlags: NodeFlags;
/**
* Order: parents before children, but children in reverse order.
* Especially providers are after elements / anchors.
*/
reverseChildNodes: NodeDef[];
rootNodeFlags: NodeFlags;
lastRenderRootNode: NodeDef;

@@ -40,3 +36,3 @@ bindingCount: number;

export declare type ViewHandleEventFn = (view: ViewData, nodeIndex: number, eventName: string, event: any) => boolean;
export declare enum ArgumentType {
export declare const enum ArgumentType {
Inline = 0,

@@ -48,3 +44,3 @@ Dynamic = 1,

*/
export declare enum ViewFlags {
export declare const enum ViewFlags {
None = 0,

@@ -60,6 +56,4 @@ OnPush = 2,

export interface NodeDef {
type: NodeType;
flags: NodeFlags;
index: number;
reverseChildIndex: number;
flags: NodeFlags;
parent: NodeDef;

@@ -71,4 +65,6 @@ renderParent: NodeDef;

childCount: number;
/** aggregated NodeFlags for all children (does not include self) **/
/** aggregated NodeFlags for all transitive children (does not include self) **/
childFlags: NodeFlags;
/** aggregated NodeFlags for all direct children (does not include self) **/
directChildFlags: NodeFlags;
bindingIndex: number;

@@ -101,38 +97,47 @@ bindings: BindingDef[];

text: TextDef;
pureExpression: PureExpressionDef;
query: QueryDef;
ngContent: NgContentDef;
}
export declare enum NodeType {
Element = 0,
Text = 1,
Directive = 2,
Provider = 3,
Pipe = 4,
PureExpression = 5,
Query = 6,
NgContent = 7,
}
/**
* Bitmask for NodeDef.flags.
* Naming convention:
* - `Type...`: flags that are mutually exclusive
* - `Cat...`: union of multiple `Type...` (short for category).
*/
export declare enum NodeFlags {
export declare const enum NodeFlags {
None = 0,
OnInit = 1,
OnDestroy = 2,
DoCheck = 4,
OnChanges = 8,
AfterContentInit = 16,
AfterContentChecked = 32,
AfterViewInit = 64,
AfterViewChecked = 128,
HasEmbeddedViews = 256,
HasComponent = 512,
IsComponent = 1024,
HasContentQuery = 2048,
HasStaticQuery = 4096,
HasDynamicQuery = 8192,
HasViewQuery = 16384,
LazyProvider = 32768,
PrivateProvider = 65536,
TypeElement = 1,
TypeText = 2,
CatRenderNode = 3,
TypeNgContent = 4,
TypePipe = 8,
TypePureArray = 16,
TypePureObject = 32,
TypePurePipe = 64,
CatPureExpression = 112,
TypeValueProvider = 128,
TypeClassProvider = 256,
TypeFactoryProvider = 512,
TypeUseExistingProvider = 1024,
LazyProvider = 2048,
PrivateProvider = 4096,
TypeDirective = 8192,
Component = 16384,
CatProvider = 10112,
OnInit = 32768,
OnDestroy = 65536,
DoCheck = 131072,
OnChanges = 262144,
AfterContentInit = 524288,
AfterContentChecked = 1048576,
AfterViewInit = 2097152,
AfterViewChecked = 4194304,
EmbeddedViews = 8388608,
ComponentView = 16777216,
TypeContentQuery = 33554432,
TypeViewQuery = 67108864,
StaticQuery = 134217728,
DynamicQuery = 268435456,
CatQuery = 100663296,
Types = 100673535,
}

@@ -147,3 +152,3 @@ export interface BindingDef {

}
export declare enum BindingType {
export declare const enum BindingType {
ElementAttribute = 0,

@@ -164,7 +169,7 @@ ElementClass = 1,

}
export declare enum OutputType {
export declare const enum OutputType {
ElementOutput = 0,
DirectiveOutput = 1,
}
export declare enum QueryValueType {
export declare const enum QueryValueType {
ElementRef = 0,

@@ -204,3 +209,2 @@ RenderElement = 1,

export interface ProviderDef {
type: ProviderType;
token: any;

@@ -211,8 +215,2 @@ tokenKey: string;

}
export declare enum ProviderType {
Value = 0,
Class = 1,
Factory = 2,
UseExisting = 3,
}
export interface DepDef {

@@ -226,3 +224,3 @@ flags: DepFlags;

*/
export declare enum DepFlags {
export declare const enum DepFlags {
None = 0,

@@ -237,10 +235,2 @@ SkipSelf = 1,

}
export interface PureExpressionDef {
type: PureExpressionType;
}
export declare enum PureExpressionType {
Array = 0,
Object = 1,
Pipe = 2,
}
export interface QueryDef {

@@ -255,3 +245,3 @@ id: number;

}
export declare enum QueryBindingType {
export declare const enum QueryBindingType {
First = 0,

@@ -292,3 +282,3 @@ All = 1,

*/
export declare enum ViewState {
export declare const enum ViewState {
FirstCheck = 1,

@@ -391,3 +381,3 @@ ChecksEnabled = 2,

}
export declare enum CheckType {
export declare const enum CheckType {
CheckAndUpdate = 0,

@@ -394,0 +384,0 @@ CheckNoChanges = 1,

@@ -53,1 +53,7 @@ import { ViewEncapsulation } from '../metadata/view';

export declare function splitNamespace(name: string): string[];
export declare function interpolate(valueCount: number, constAndInterp: string[]): string;
export declare function inlineInterpolate(valueCount: number, c0: string, a1: any, c1: string, a2?: any, c2?: string, a3?: any, c3?: string, a4?: any, c4?: string, a5?: any, c5?: string, a6?: any, c6?: string, a7?: any, c7?: string, a8?: any, c8?: string, a9?: any, c9?: string): string;
export declare const EMPTY_ARRAY: any[];
export declare const EMPTY_MAP: {
[key: string]: any;
};

@@ -8,3 +8,2 @@ /**

*/
export { MockAnimationPlayer as ɵMockAnimationPlayer } from './mock_animation_player';
export { TestingCompiler as ɵTestingCompiler, TestingCompilerFactory as ɵTestingCompilerFactory } from './test_compiler';

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./mock_animation_player","export":[{"name":"MockAnimationPlayer","as":"ɵMockAnimationPlayer"}]},{"from":"./test_compiler","export":[{"name":"TestingCompiler","as":"ɵTestingCompiler"},{"name":"TestingCompilerFactory","as":"ɵTestingCompilerFactory"}]}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./mock_animation_player","export":[{"name":"MockAnimationPlayer","as":"ɵMockAnimationPlayer"}]},{"from":"./test_compiler","export":[{"name":"TestingCompiler","as":"ɵTestingCompiler"},{"name":"TestingCompilerFactory","as":"ɵTestingCompilerFactory"}]}]}]
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./test_compiler","export":[{"name":"TestingCompiler","as":"ɵTestingCompiler"},{"name":"TestingCompilerFactory","as":"ɵTestingCompilerFactory"}]}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./test_compiler","export":[{"name":"TestingCompiler","as":"ɵTestingCompiler"},{"name":"TestingCompilerFactory","as":"ɵTestingCompilerFactory"}]}]}]

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc