fix(common): add upgrade sub-package to ng_package rule for @angular/common (#30117)
Follow-up to #30055 to include @angular/common/upgrade in the npm package Closes #30116 PR Close #30117
This commit is contained in:

committed by
Andrew Kushnir

parent
61365a94ed
commit
6de4cbdd41
@ -6,6 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export * from './location_upgrade_module';
|
||||
export * from './$location_shim';
|
||||
export * from './params';
|
||||
export {$locationShim, $locationShimProvider} from './location_shim';
|
||||
export {LOCATION_UPGRADE_CONFIGURATION, LocationUpgradeConfig, LocationUpgradeModule} from './location_upgrade_module';
|
||||
export {AngularJSUrlCodec, UrlCodec} from './params';
|
||||
|
@ -10,7 +10,7 @@ import {APP_BASE_HREF, CommonModule, HashLocationStrategy, Location, LocationStr
|
||||
import {Inject, InjectionToken, ModuleWithProviders, NgModule, Optional} from '@angular/core';
|
||||
import {UpgradeModule} from '@angular/upgrade/static';
|
||||
|
||||
import {$locationShim, $locationShimProvider} from './$location_shim';
|
||||
import {$locationShim, $locationShimProvider} from './location_shim';
|
||||
import {AngularJSUrlCodec, UrlCodec} from './params';
|
||||
|
||||
|
||||
@ -75,7 +75,6 @@ export class LocationUpgradeModule {
|
||||
}
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function provideAppBaseHref(config: LocationUpgradeConfig, appBaseHref?: string) {
|
||||
if (config && config.appBaseHref != null) {
|
||||
return config.appBaseHref;
|
||||
@ -85,20 +84,17 @@ export function provideAppBaseHref(config: LocationUpgradeConfig, appBaseHref?:
|
||||
return '';
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function provideUrlCodec(config: LocationUpgradeConfig) {
|
||||
const codec = config && config.urlCodec || AngularJSUrlCodec;
|
||||
return new (codec as any)();
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function provideLocationStrategy(
|
||||
platformLocation: PlatformLocation, baseHref: string, options: LocationUpgradeConfig = {}) {
|
||||
return options.useHash ? new HashLocationStrategy(platformLocation, baseHref) :
|
||||
new PathLocationStrategy(platformLocation, baseHref);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function provide$location(
|
||||
ngUpgrade: UpgradeModule, location: Location, platformLocation: PlatformLocation,
|
||||
urlCodec: UrlCodec, locationStrategy: LocationStrategy) {
|
||||
|
Reference in New Issue
Block a user