Permalink
Browse files

chore(facade): remove most facade/async functions

  • Loading branch information...
Jason Choi authored and alxhub committed Aug 2, 2016
1 parent 6baf3ba commit 99989f5d3fc4543743e870b781ae687deb4cf7af
Showing with 1,589 additions and 1,678 deletions.
  1. +2 −2 modules/@angular/common/src/forms-deprecated/directives/ng_control_name.ts
  2. +9 −7 modules/@angular/common/src/forms-deprecated/directives/ng_form.ts
  3. +2 −2 modules/@angular/common/src/forms-deprecated/directives/ng_form_control.ts
  4. +2 −2 modules/@angular/common/src/forms-deprecated/directives/ng_form_model.ts
  5. +2 −2 modules/@angular/common/src/forms-deprecated/directives/ng_model.ts
  6. +12 −8 modules/@angular/common/src/forms-deprecated/model.ts
  7. +6 −4 modules/@angular/common/src/forms-deprecated/validators.ts
  8. +3 −7 modules/@angular/common/src/location/location.ts
  9. +5 −5 modules/@angular/common/src/pipes/async_pipe.ts
  10. +6 −5 modules/@angular/common/test/directives/ng_for_spec.ts
  11. +4 −5 modules/@angular/common/test/directives/ng_if_spec.ts
  12. +4 −5 modules/@angular/common/test/directives/ng_plural_spec.ts
  13. +3 −4 modules/@angular/common/test/directives/ng_switch_spec.ts
  14. +4 −4 modules/@angular/common/test/directives/ng_template_outlet_spec.ts
  15. +4 −4 modules/@angular/common/test/directives/non_bindable_spec.ts
  16. +12 −18 modules/@angular/common/test/forms-deprecated/directives_spec.ts
  17. +1 −3 modules/@angular/common/test/forms-deprecated/form_builder_spec.ts
  18. +13 −18 modules/@angular/common/test/forms-deprecated/integration_spec.ts
  19. +95 −71 modules/@angular/common/test/forms-deprecated/model_spec.ts
  20. +5 −6 modules/@angular/common/test/forms-deprecated/validators_spec.ts
  21. +47 −45 modules/@angular/common/test/pipes/async_pipe_spec.ts
  22. +5 −5 modules/@angular/common/test/pipes/json_pipe_spec.ts
  23. +2 −3 modules/@angular/common/test/pipes/number_pipe_spec.ts
  24. +1 −3 modules/@angular/common/test/pipes/replace_pipe_spec.ts
  25. +4 −5 modules/@angular/common/test/pipes/slice_pipe_spec.ts
  26. +5 −8 modules/@angular/common/testing/location_mock.ts
  27. +3 −3 modules/@angular/common/testing/mock_location_strategy.ts
  28. +4 −3 modules/@angular/compiler/src/html_parser/parser.ts
  29. +4 −3 modules/@angular/compiler/src/lifecycle_reflector.ts
  30. +1 −2 modules/@angular/compiler/src/output/output_interpreter.ts
  31. +4 −3 modules/@angular/compiler/src/output/output_jit.ts
  32. +2 −3 modules/@angular/compiler/src/runtime_compiler.ts
  33. +5 −4 modules/@angular/compiler/src/template_parser/template_ast.ts
  34. +17 −15 modules/@angular/compiler/src/template_parser/template_parser.ts
  35. +4 −5 modules/@angular/compiler/src/view_compiler/compile_element.ts
  36. +8 −6 modules/@angular/compiler/src/view_compiler/property_binder.ts
  37. +3 −3 modules/@angular/compiler/src/view_compiler/util.ts
  38. +8 −7 modules/@angular/compiler/src/view_compiler/view_binder.ts
  39. +1 −2 modules/@angular/compiler/test/directive_lifecycle_spec.ts
  40. +3 −3 modules/@angular/compiler/test/directive_resolver_mock_spec.ts
  41. +3 −3 modules/@angular/compiler/test/ng_module_resolver_mock_spec.ts
  42. +1 −2 modules/@angular/compiler/test/output/abstract_emitter_spec.ts
  43. +5 −4 modules/@angular/compiler/test/output/js_emitter_spec.ts
  44. +7 −7 modules/@angular/compiler/test/output/output_emitter_spec.ts
  45. +5 −4 modules/@angular/compiler/test/output/ts_emitter_spec.ts
  46. +3 −3 modules/@angular/compiler/test/pipe_resolver_mock_spec.ts
  47. +6 −5 modules/@angular/compiler/test/runtime_compiler_spec.ts
  48. +3 −3 modules/@angular/compiler/test/shadow_css_spec.ts
  49. +8 −11 modules/@angular/compiler/test/test_component_builder_spec.ts
  50. +2 −3 modules/@angular/compiler/test/xhr_mock_spec.ts
  51. +13 −7 modules/@angular/compiler/testing/xhr_mock.ts
  52. +5 −5 modules/@angular/core/src/application_ref.ts
  53. +8 −6 modules/@angular/core/src/di/reflective_provider.ts
  54. +11 −11 modules/@angular/core/src/linker/view.ts
  55. +2 −2 modules/@angular/core/src/metadata.ts
  56. +13 −10 modules/@angular/core/src/testability/testability.ts
  57. +7 −8 modules/@angular/core/test/application_init_spec.ts
  58. +13 −14 modules/@angular/core/test/application_ref_spec.ts
  59. +6 −9 modules/@angular/core/test/debug/debug_node_spec.ts
  60. +1 −2 modules/@angular/core/test/di/binding_spec.ts
  61. +2 −1 modules/@angular/core/test/di/forward_ref_spec.ts
  62. +4 −5 modules/@angular/core/test/di/reflective_injector_spec.ts
  63. +1 −2 modules/@angular/core/test/dom/dom_adapter_spec.ts
  64. +35 −36 modules/@angular/core/test/fake_async_spec.ts
  65. +14 −13 modules/@angular/core/test/linker/dynamic_component_loader_spec.ts
  66. +5 −4 modules/@angular/core/test/linker/entry_components_integration_spec.ts
  67. +45 −50 modules/@angular/core/test/linker/integration_spec.ts
  68. +4 −4 modules/@angular/core/test/linker/ng_container_integration_spec.ts
  69. +5 −7 modules/@angular/core/test/linker/projection_integration_spec.ts
  70. +16 −14 modules/@angular/core/test/linker/query_integration_spec.ts
  71. +7 −7 modules/@angular/core/test/linker/query_list_spec.ts
  72. +4 −5 modules/@angular/core/test/linker/regression_integration_spec.ts
  73. +2 −2 modules/@angular/core/test/linker/security_integration_spec.ts
  74. +7 −6 modules/@angular/core/test/linker/view_injector_integration_spec.ts
  75. +1 −2 modules/@angular/core/test/metadata/decorators_spec.ts
  76. +2 −3 modules/@angular/core/test/metadata/di_spec.ts
  77. +4 −3 modules/@angular/core/test/reflection/reflector_spec.ts
  78. +6 −4 modules/@angular/core/test/testability/testability_spec.ts
  79. +4 −4 modules/@angular/core/test/util/decorators_spec.ts
  80. +149 −118 modules/@angular/core/test/zone/ng_zone_spec.ts
  81. +9 −6 modules/@angular/core/testing/async_test_completer.ts
  82. +40 −36 modules/@angular/core/testing/component_fixture.ts
  83. +2 −2 modules/@angular/core/testing/ng_zone_mock.ts
  84. +3 −4 modules/@angular/core/testing/test_component_builder.ts
  85. +0 −53 modules/@angular/facade/src/async.ts
  86. +0 −61 modules/@angular/facade/src/promise.ts
  87. +55 −116 modules/@angular/facade/test/async_spec.ts
  88. +9 −7 modules/@angular/forms/src/directives/ng_form.ts
  89. +5 −3 modules/@angular/forms/src/directives/ng_model.ts
  90. +2 −2 modules/@angular/forms/src/directives/reactive_directives/form_control_directive.ts
  91. +2 −2 modules/@angular/forms/src/directives/reactive_directives/form_control_name.ts
  92. +2 −2 modules/@angular/forms/src/directives/reactive_directives/form_group_directive.ts
  93. +11 −8 modules/@angular/forms/src/model.ts
  94. +5 −4 modules/@angular/forms/src/validators.ts
  95. +9 −13 modules/@angular/forms/test/directives_spec.ts
  96. +1 −3 modules/@angular/forms/test/form_builder_spec.ts
  97. +93 −66 modules/@angular/forms/test/model_spec.ts
  98. +15 −17 modules/@angular/forms/test/reactive_integration_spec.ts
  99. +3 −5 modules/@angular/forms/test/template_integration_spec.ts
  100. +5 −6 modules/@angular/forms/test/validators_spec.ts
  101. +1 −1 modules/@angular/http/src/headers.ts
  102. +10 −10 modules/@angular/http/test/backends/jsonp_backend_spec.ts
  103. +7 −6 modules/@angular/http/test/backends/mock_backend_spec.ts
  104. +10 −9 modules/@angular/http/test/backends/xhr_backend_spec.ts
  105. +1 −1 modules/@angular/http/test/static_response_spec.ts
  106. +0 −1 modules/@angular/platform-browser-dynamic/index.ts
  107. +2 −3 modules/@angular/platform-browser-dynamic/src/xhr/xhr_cache.ts
  108. +10 −6 modules/@angular/platform-browser-dynamic/src/xhr/xhr_impl.ts
  109. +10 −6 modules/@angular/platform-browser-dynamic/test/testing_public_browser_spec.ts
  110. +1 −3 modules/@angular/platform-browser-dynamic/test/xhr/xhr_impl_spec.ts
  111. +5 −7 modules/@angular/platform-browser/src/dom/dom_renderer.ts
  112. +3 −3 modules/@angular/platform-browser/src/dom/events/key_events.ts
  113. +16 −10 modules/@angular/platform-browser/src/web_workers/shared/client_message_broker.ts
  114. +3 −4 modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts
  115. +4 −5 modules/@angular/platform-browser/src/web_workers/shared/service_message_broker.ts
  116. +2 −2 modules/@angular/platform-browser/src/web_workers/ui/event_dispatcher.ts
  117. +3 −3 modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts
  118. +24 −22 modules/@angular/platform-browser/src/web_workers/worker/platform_location.ts
  119. +1 −2 modules/@angular/platform-browser/src/web_workers/worker/renderer.ts
  120. +6 −8 modules/@angular/platform-browser/test/browser/bootstrap_spec.ts
  121. +1 −1 modules/@angular/platform-browser/test/dom/dom_renderer_integration_spec.ts
  122. +4 −3 modules/@angular/platform-browser/test/dom/events/event_manager_spec.ts
  123. +1 −1 modules/@angular/platform-browser/test/dom/events/key_events_spec.ts
  124. +2 −2 modules/@angular/platform-browser/test/dom/shared_styles_host_spec.ts
  125. +23 −13 modules/@angular/platform-browser/test/testing_public_spec.ts
  126. +29 −25 modules/@angular/platform-browser/test/web_workers/shared/message_bus_spec.ts
  127. +21 −15 modules/@angular/platform-browser/test/web_workers/shared/service_message_broker_spec.ts
  128. +7 −3 modules/@angular/platform-browser/test/web_workers/shared/web_worker_test_util.ts
  129. +1 −3 modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts
  130. +14 −13 modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts
  131. +1 −1 modules/@angular/platform-server/core_private.ts
  132. +4 −4 modules/@angular/router-deprecated/src/directives/router_outlet.ts
  133. +2 −5 modules/@angular/router-deprecated/src/instruction.ts
  134. +14 −14 modules/@angular/router-deprecated/src/route_registry.ts
  135. +10 −12 modules/@angular/router-deprecated/src/router.ts
  136. +1 −2 modules/@angular/router-deprecated/src/rules/route_handlers/sync_route_handler.ts
  137. +2 −3 modules/@angular/router-deprecated/src/rules/rule_set.ts
  138. +1 −2 modules/@angular/router-deprecated/src/rules/rules.ts
  139. +7 −7 modules/@angular/router-deprecated/test/directives/router_link_spec.ts
  140. +2 −3 modules/@angular/router-deprecated/test/integration/auxiliary_route_spec.ts
  141. +1 −3 modules/@angular/router-deprecated/test/integration/bootstrap_spec.ts
  142. +7 −9 modules/@angular/router-deprecated/test/integration/impl/async_route_spec_impl.ts
  143. +8 −10 modules/@angular/router-deprecated/test/integration/impl/fixture_components.ts
  144. +8 −9 modules/@angular/router-deprecated/test/integration/impl/sync_route_spec_impl.ts
  145. +74 −40 modules/@angular/router-deprecated/test/integration/lifecycle_hook_spec.ts
  146. +3 −6 modules/@angular/router-deprecated/test/integration/navigation_spec.ts
  147. +10 −11 modules/@angular/router-deprecated/test/integration/router_link_spec.ts
  148. +2 −3 modules/@angular/router-deprecated/test/location/hash_location_strategy_spec.ts
  149. +2 −3 modules/@angular/router-deprecated/test/location/location_spec.ts
  150. +3 −3 modules/@angular/router-deprecated/test/location/path_location_strategy_spec.ts
  151. +7 −8 modules/@angular/router-deprecated/test/route_config/route_config_spec.ts
  152. +4 −7 modules/@angular/router-deprecated/test/route_registry_spec.ts
  153. +6 −9 modules/@angular/router-deprecated/test/router_spec.ts
  154. +2 −2 modules/@angular/router-deprecated/test/rules/route_paths/param_route_path_spec.ts
  155. +2 −2 modules/@angular/router-deprecated/test/rules/route_paths/regex_route_param_spec.ts
  156. +5 −6 modules/@angular/router-deprecated/test/rules/rule_set_spec.ts
  157. +2 −2 modules/@angular/router-deprecated/test/url_parser_spec.ts
  158. +1 −2 modules/@angular/upgrade/test/metadata_spec.ts
  159. +2 −5 modules/benchmarks/e2e_test/largetable_perf.ts
  160. +4 −5 modules/benchpress/src/metric/multi_metric.ts
  161. +6 −7 modules/benchpress/src/metric/perflog_metric.ts
  162. +14 −10 modules/benchpress/src/metric/user_metric.ts
  163. +2 −3 modules/benchpress/src/reporter/console_reporter.ts
  164. +1 −4 modules/benchpress/src/reporter/json_file_reporter.ts
  165. +2 −4 modules/benchpress/src/reporter/multi_reporter.ts
  166. +1 −2 modules/benchpress/src/runner.ts
  167. +1 −2 modules/benchpress/src/sampler.ts
  168. +9 −4 modules/benchpress/src/webdriver/selenium_webdriver_adapter.ts
  169. +25 −26 modules/benchpress/test/metric/perflog_metric_spec.ts
  170. +4 −5 modules/benchpress/test/metric/user_metric_spec.ts
  171. +1 −2 modules/benchpress/test/reporter/json_file_reporter_spec.ts
  172. +3 −4 modules/benchpress/test/reporter/multi_reporter_spec.ts
  173. +2 −3 modules/benchpress/test/runner_spec.ts
  174. +7 −8 modules/benchpress/test/sampler_spec.ts
  175. +12 −9 modules/benchpress/test/web_driver_extension_spec.ts
  176. +16 −18 modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts
  177. +3 −5 modules/benchpress/test/webdriver/ios_driver_extension_spec.ts
  178. +6 −7 modules/playground/src/async/index.ts
  179. +4 −9 modules/playground/src/routing/app/inbox-app.ts
  180. +1 −2 modules/playground/src/routing/app/inbox-detail.ts
  181. +5 −10 modules/playground/src/routing_deprecated/app/inbox-app.ts
  182. +1 −2 modules/playground/src/web_workers/images/index_common.ts
  183. +7 −2 modules/playground/src/web_workers/message_broker/index_common.ts
  184. +2 −3 modules/playground/src/zippy_component/app/zippy.ts
@@ -8,7 +8,7 @@
import {Directive, Host, Inject, OnChanges, OnDestroy, Optional, Self, SimpleChanges, SkipSelf, forwardRef} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../facade/async';
import {EventEmitter} from '../../facade/async';
import {Control} from '../model';
import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators';
@@ -122,7 +122,7 @@ export class NgControlName extends NgControl implements OnChanges,
viewToModelUpdate(newValue: any): void {
this.viewModel = newValue;
ObservableWrapper.callEmit(this.update, newValue);
this.update.emit(newValue);
}
get path(): string[] { return controlPath(this.name, this._parent); }
@@ -8,7 +8,7 @@
import {Directive, Inject, Optional, Self, forwardRef} from '@angular/core';
import {EventEmitter, ObservableWrapper, PromiseWrapper} from '../../facade/async';
import {EventEmitter} from '../../facade/async';
import {ListWrapper} from '../../facade/collection';
import {isPresent} from '../../facade/lang';
import {AbstractControl, Control, ControlGroup} from '../model';
@@ -27,6 +27,8 @@ export const formDirectiveProvider: any = {
let _formWarningDisplayed: boolean = false;
const resolvedPromise = Promise.resolve(null);
/**
* If `NgForm` is bound in a component, `<form>` elements in that component will be
* upgraded to use the Angular form system.
@@ -136,7 +138,7 @@ export class NgForm extends ControlContainer implements Form {
get controls(): {[key: string]: AbstractControl} { return this.form.controls; }
addControl(dir: NgControl): void {
PromiseWrapper.scheduleMicrotask(() => {
resolvedPromise.then(() => {
var container = this._findContainer(dir.path);
var ctrl = new Control();
setUpControl(ctrl, dir);
@@ -148,7 +150,7 @@ export class NgForm extends ControlContainer implements Form {
getControl(dir: NgControl): Control { return <Control>this.form.find(dir.path); }
removeControl(dir: NgControl): void {
PromiseWrapper.scheduleMicrotask(() => {
resolvedPromise.then(() => {
var container = this._findContainer(dir.path);
if (isPresent(container)) {
container.removeControl(dir.name);
@@ -157,7 +159,7 @@ export class NgForm extends ControlContainer implements Form {
}
addControlGroup(dir: NgControlGroup): void {
PromiseWrapper.scheduleMicrotask(() => {
resolvedPromise.then(() => {
var container = this._findContainer(dir.path);
var group = new ControlGroup({});
setUpControlGroup(group, dir);
@@ -167,7 +169,7 @@ export class NgForm extends ControlContainer implements Form {
}
removeControlGroup(dir: NgControlGroup): void {
PromiseWrapper.scheduleMicrotask(() => {
resolvedPromise.then(() => {
var container = this._findContainer(dir.path);
if (isPresent(container)) {
container.removeControl(dir.name);
@@ -180,15 +182,15 @@ export class NgForm extends ControlContainer implements Form {
}
updateModel(dir: NgControl, value: any): void {
PromiseWrapper.scheduleMicrotask(() => {
resolvedPromise.then(() => {
var ctrl = <Control>this.form.find(dir.path);
ctrl.updateValue(value);
});
}
onSubmit(): boolean {
this._submitted = true;
ObservableWrapper.callEmit(this.ngSubmit, null);
this.ngSubmit.emit(null);
return false;
}
@@ -8,7 +8,7 @@
import {Directive, Inject, OnChanges, Optional, Self, SimpleChanges, forwardRef} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../facade/async';
import {EventEmitter} from '../../facade/async';
import {StringMapWrapper} from '../../facade/collection';
import {Control} from '../model';
import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators';
@@ -118,7 +118,7 @@ export class NgFormControl extends NgControl implements OnChanges {
viewToModelUpdate(newValue: any): void {
this.viewModel = newValue;
ObservableWrapper.callEmit(this.update, newValue);
this.update.emit(newValue);
}
private _isControlChanged(changes: {[key: string]: any}): boolean {
@@ -8,7 +8,7 @@
import {Directive, Inject, OnChanges, Optional, Self, SimpleChanges, forwardRef} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../facade/async';
import {EventEmitter} from '../../facade/async';
import {ListWrapper, StringMapWrapper} from '../../facade/collection';
import {BaseException} from '../../facade/exceptions';
import {isBlank} from '../../facade/lang';
@@ -191,7 +191,7 @@ export class NgFormModel extends ControlContainer implements Form,
onSubmit(): boolean {
this._submitted = true;
ObservableWrapper.callEmit(this.ngSubmit, null);
this.ngSubmit.emit(null);
return false;
}
@@ -8,7 +8,7 @@
import {Directive, Inject, OnChanges, Optional, Self, SimpleChanges, forwardRef} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../facade/async';
import {EventEmitter} from '../../facade/async';
import {Control} from '../model';
import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators';
@@ -94,6 +94,6 @@ export class NgModel extends NgControl implements OnChanges {
viewToModelUpdate(newValue: any): void {
this.viewModel = newValue;
ObservableWrapper.callEmit(this.update, newValue);
this.update.emit(newValue);
}
}
@@ -6,11 +6,15 @@
* found in the LICENSE file at https://angular.io/license
*/
import {EventEmitter, Observable, ObservableWrapper} from '../facade/async';
import {PromiseObservable} from 'rxjs/observable/PromiseObservable';
import {EventEmitter, Observable} from '../facade/async';
import {ListWrapper, StringMapWrapper} from '../facade/collection';
import {isBlank, isPresent, isPromise, normalizeBool} from '../facade/lang';
import {AsyncValidatorFn, ValidatorFn} from './directives/validators';
/**
* Indicates that a Control is valid, i.e. that no errors exist in the input value.
*/
@@ -52,7 +56,7 @@ function _find(control: AbstractControl, path: Array<string|number>| string) {
}
function toObservable(r: any): Observable<any> {
return isPromise(r) ? ObservableWrapper.fromPromise(r) : r;
return isPromise(r) ? PromiseObservable.create(r) : r;
}
/**
@@ -135,8 +139,8 @@ export abstract class AbstractControl {
}
if (emitEvent) {
ObservableWrapper.callEmit(this._valueChanges, this._value);
ObservableWrapper.callEmit(this._statusChanges, this._status);
this._valueChanges.emit(this._value);
this._statusChanges.emit(this._status);
}
if (isPresent(this._parent) && !onlySelf) {
@@ -153,14 +157,14 @@ export abstract class AbstractControl {
this._status = PENDING;
this._cancelExistingSubscription();
var obs = toObservable(this.asyncValidator(this));
this._asyncValidationSubscription = ObservableWrapper.subscribe(
obs, (res: {[key: string]: any}) => this.setErrors(res, {emitEvent: emitEvent}));
this._asyncValidationSubscription = obs.subscribe(
{next: (res: {[key: string]: any}) => this.setErrors(res, {emitEvent: emitEvent})});
}
}
private _cancelExistingSubscription(): void {
if (isPresent(this._asyncValidationSubscription)) {
ObservableWrapper.dispose(this._asyncValidationSubscription);
this._asyncValidationSubscription.unsubscribe();
}
}
@@ -194,7 +198,7 @@ export abstract class AbstractControl {
this._status = this._calculateStatus();
if (emitEvent) {
ObservableWrapper.callEmit(this._statusChanges, this._status);
this._statusChanges.emit(this._status);
}
if (isPresent(this._parent)) {
@@ -7,13 +7,15 @@
*/
import {OpaqueToken} from '@angular/core';
import {ObservableWrapper} from '../facade/async';
import {toPromise} from 'rxjs/operator/toPromise';
import {StringMapWrapper} from '../facade/collection';
import {isBlank, isPresent, isPromise, isString} from '../facade/lang';
import {PromiseWrapper} from '../facade/promise';
import {AsyncValidatorFn, ValidatorFn} from './directives/validators';
import {AbstractControl} from './model';
/**
* Providers for validators to be used for {@link Control}s in a form.
*
@@ -127,13 +129,13 @@ export class Validators {
return function(control: AbstractControl) {
let promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise);
return PromiseWrapper.all(promises).then(_mergeErrors);
return Promise.all(promises).then(_mergeErrors);
};
}
}
function _convertToPromise(obj: any): Promise<any> {
return isPromise(obj) ? obj : ObservableWrapper.toPromise(obj);
return isPromise(obj) ? obj : toPromise.call(obj);
}
function _executeValidators(control: AbstractControl, validators: ValidatorFn[]): any[] {
@@ -8,8 +8,6 @@
import {EventEmitter, Injectable} from '@angular/core';
import {ObservableWrapper} from '../facade/async';
import {LocationStrategy} from './location_strategy';
@@ -69,10 +67,8 @@ export class Location {
this._platformStrategy = platformStrategy;
var browserBaseHref = this._platformStrategy.getBaseHref();
this._baseHref = Location.stripTrailingSlash(_stripIndexHtml(browserBaseHref));
this._platformStrategy.onPopState((ev) => {
ObservableWrapper.callEmit(
this._subject, {'url': this.path(true), 'pop': true, 'type': ev.type});
});
this._platformStrategy.onPopState(
(ev) => { this._subject.emit({'url': this.path(true), 'pop': true, 'type': ev.type}); });
}
/**
@@ -145,7 +141,7 @@ export class Location {
subscribe(
onNext: (value: any) => void, onThrow: (exception: any) => void = null,
onReturn: () => void = null): Object {
return ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
return this._subject.subscribe({next: onNext, error: onThrow, complete: onReturn});
}
/**
@@ -7,7 +7,7 @@
*/
import {ChangeDetectorRef, OnDestroy, Pipe, WrappedValue} from '@angular/core';
import {EventEmitter, Observable, ObservableWrapper} from '../facade/async';
import {EventEmitter, Observable} from '../facade/async';
import {isBlank, isPresent, isPromise} from '../facade/lang';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
@@ -19,12 +19,12 @@ interface SubscriptionStrategy {
class ObservableStrategy implements SubscriptionStrategy {
createSubscription(async: any, updateLatestValue: any): any {
return ObservableWrapper.subscribe(async, updateLatestValue, e => { throw e; });
return async.subscribe({next: updateLatestValue, error: (e: any) => { throw e; }});
}
dispose(subscription: any): void { ObservableWrapper.dispose(subscription); }
dispose(subscription: any): void { subscription.unsubscribe(); }
onDestroy(subscription: any): void { ObservableWrapper.dispose(subscription); }
onDestroy(subscription: any): void { subscription.unsubscribe(); }
}
class PromiseStrategy implements SubscriptionStrategy {
@@ -125,7 +125,7 @@ export class AsyncPipe implements OnDestroy {
_selectStrategy(obj: Observable<any>|Promise<any>|EventEmitter<any>): any {
if (isPromise(obj)) {
return _promiseStrategy;
} else if (ObservableWrapper.isObservable(obj)) {
} else if ((<any>obj).subscribe) {
return _observableStrategy;
} else {
throw new InvalidPipeArgumentException(AsyncPipe, obj);
@@ -6,13 +6,14 @@
* found in the LICENSE file at https://angular.io/license
*/
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder} from '@angular/core/testing';
import {ListWrapper} from '../../src/facade/collection';
import {Component, TemplateRef, ContentChild} from '@angular/core';
import {NgFor, NgIf} from '@angular/common';
import {expect} from '@angular/platform-browser/testing/matchers';
import {Component, ContentChild, TemplateRef} from '@angular/core';
import {TestComponentBuilder} from '@angular/core/testing';
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
import {By} from '@angular/platform-browser/src/dom/debug/by';
import {expect} from '@angular/platform-browser/testing/matchers';
import {ListWrapper} from '../../src/facade/collection';
let thisArg: any;
@@ -6,13 +6,12 @@
* found in the LICENSE file at https://angular.io/license
*/
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
import {NgIf} from '@angular/common';
import {Component} from '@angular/core';
import {TestComponentBuilder} from '@angular/core/testing';
import {expect} from '@angular/platform-browser/testing/matchers';
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {Component} from '@angular/core';
import {NgIf} from '@angular/common';
import {expect} from '@angular/platform-browser/testing/matchers';
export function main() {
describe('ngIf directive', () => {
@@ -6,12 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {AsyncTestCompleter, beforeEachProviders, beforeEach, ddescribe, describe, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers';
import {TestComponentBuilder} from '@angular/core/testing';
import {NgLocalization, NgPlural, NgPluralCase} from '@angular/common';
import {Component, Injectable} from '@angular/core';
import {NgPlural, NgPluralCase, NgLocalization} from '@angular/common';
import {TestComponentBuilder} from '@angular/core/testing';
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers';
export function main() {
describe('switch', () => {
@@ -6,12 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers';
import {NgSwitch, NgSwitchCase, NgSwitchDefault} from '@angular/common';
import {Component} from '@angular/core';
import {TestComponentBuilder} from '@angular/core/testing';
import {NgSwitch, NgSwitchCase, NgSwitchDefault} from '@angular/common';
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers';
export function main() {
describe('switch', () => {
@@ -6,11 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers';
import {TestComponentBuilder} from '@angular/core/testing';
import {Component, Directive, TemplateRef, ContentChildren, QueryList} from '@angular/core';
import {NgTemplateOutlet} from '@angular/common';
import {Component, ContentChildren, Directive, QueryList, TemplateRef} from '@angular/core';
import {TestComponentBuilder} from '@angular/core/testing';
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers';
export function main() {
describe('insert', () => {
Oops, something went wrong.

0 comments on commit 99989f5

Please sign in to comment.