refactor: update angular to support TypeScript 2.4

Detailed updates:
- rxjs@5.0.x
- tsickle@0.24.x
- typescript@2.4.x
- @bazel/typescript@0.10.0
- protractor@5.1.x
- selenium-webdriver@3.0.x

BREAKING CHANGE:
- the Angular compiler now requires TypeScript 2.4.x.
This commit is contained in:
Tobias Bosch
2017-09-08 18:40:32 -07:00
committed by Matias Niemelä
parent 112e777b90
commit ca5aebaa6b
49 changed files with 429 additions and 363 deletions

View File

@ -550,9 +550,10 @@ export class UpgradeAdapter {
(ng1Injector: angular.IInjectorService, rootScope: angular.IRootScopeService) => {
UpgradeNg1ComponentAdapterBuilder.resolve(this.ng1ComponentsToBeUpgraded, ng1Injector)
.then(() => {
// At this point we have ng1 injector and we have prepared
// ng1 components to be upgraded, we now can bootstrap ng2.
@NgModule({
// Note: There is a bug in TS 2.4 that prevents us from
// inlining this into @NgModule
// TODO(tbosch): find or file a bug against TypeScript for this.
const ngModule = {
providers: [
{provide: $INJECTOR, useFactory: () => ng1Injector},
{provide: $COMPILE, useFactory: () => ng1Injector.get($COMPILE)},
@ -560,7 +561,10 @@ export class UpgradeAdapter {
],
imports: [this.ng2AppModule],
entryComponents: this.downgradedComponents
})
};
// At this point we have ng1 injector and we have prepared
// ng1 components to be upgraded, we now can bootstrap ng2.
@NgModule(ngModule)
class DynamicNgUpgradeModule {
constructor() {}
ngDoBootstrap() {}

View File

@ -38,7 +38,12 @@ export class UpgradeNg1ComponentAdapterBuilder {
name.replace(CAMEL_CASE, (all: string, next: string) => '-' + next.toLowerCase());
const self = this;
@Directive({selector: selector, inputs: this.inputsRename, outputs: this.outputsRename})
// Note: There is a bug in TS 2.4 that prevents us from
// inlining this into @Directive
// TODO(tbosch): find or file a bug against TypeScript for this.
const directive = {selector: selector, inputs: this.inputsRename, outputs: this.outputsRename};
@Directive(directive)
class MyClass {
directive: angular.IDirective;
constructor(