feat(upgrade): support multi-slot projection in upgrade/static (#14282)
Closes #14261
This commit is contained in:

committed by
Chuck Jazdzewski

parent
ab40fcb068
commit
914797a8ff
24
packages/upgrade/src/dynamic/ng_content_selector_helper.ts
Normal file
24
packages/upgrade/src/dynamic/ng_content_selector_helper.ts
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @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 {Compiler, Injectable} from '@angular/core';
|
||||
|
||||
import {ComponentInfo} from '../common/component_info';
|
||||
import {NgContentSelectorHelper} from '../common/ng_content_selector_helper';
|
||||
|
||||
|
||||
/**
|
||||
* See `NgContentSelectorHelper` for more information about this class.
|
||||
*/
|
||||
@Injectable()
|
||||
export class DynamicNgContentSelectorHelper extends NgContentSelectorHelper {
|
||||
constructor(private compiler: Compiler) { super(); }
|
||||
getNgContentSelectors(info: ComponentInfo): string[] {
|
||||
return this.compiler.getNgContentSelectors(info.component);
|
||||
}
|
||||
}
|
@ -13,12 +13,12 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
import * as angular from '../common/angular1';
|
||||
import {ComponentInfo} from '../common/component_info';
|
||||
import {$$TESTABILITY, $COMPILE, $INJECTOR, $ROOT_SCOPE, COMPILER_KEY, INJECTOR_KEY, NG_ZONE_KEY} from '../common/constants';
|
||||
import {ContentProjectionHelper} from '../common/content_projection_helper';
|
||||
import {downgradeComponent} from '../common/downgrade_component';
|
||||
import {downgradeInjectable} from '../common/downgrade_injectable';
|
||||
import {NgContentSelectorHelper} from '../common/ng_content_selector_helper';
|
||||
import {Deferred, controllerKey, onError} from '../common/util';
|
||||
|
||||
import {DynamicContentProjectionHelper} from './content_projection_helper';
|
||||
import {DynamicNgContentSelectorHelper} from './ng_content_selector_helper';
|
||||
import {UpgradeNg1ComponentAdapterBuilder} from './upgrade_ng1_adapter';
|
||||
|
||||
let upgradeCount: number = 0;
|
||||
@ -561,7 +561,7 @@ export class UpgradeAdapter {
|
||||
providers: [
|
||||
{provide: $INJECTOR, useFactory: () => ng1Injector},
|
||||
{provide: $COMPILE, useFactory: () => ng1Injector.get($COMPILE)},
|
||||
{provide: ContentProjectionHelper, useClass: DynamicContentProjectionHelper},
|
||||
{provide: NgContentSelectorHelper, useClass: DynamicNgContentSelectorHelper},
|
||||
this.upgradedProviders
|
||||
],
|
||||
imports: [this.ng2AppModule],
|
||||
|
Reference in New Issue
Block a user