refactor(platform-browser): remove deprecated `NgProbeToken` (#18760)
BREAKING CHANGE: `NgProbeToken` has been removed from `@angular/platform-browser` as it was deprecated since v4. Import it from `@angular/core` instead. PR Close #18760
This commit is contained in:
parent
8f413268cf
commit
d7f42bfbe6
|
@ -26,22 +26,13 @@ export function inspectNativeElement(element: any): core.DebugNode|null {
|
|||
return core.getDebugNode(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated. Use the one from '@angular/core'.
|
||||
* @deprecated
|
||||
*/
|
||||
export class NgProbeToken {
|
||||
constructor(public name: string, public token: any) {}
|
||||
}
|
||||
|
||||
export function _createNgProbe(extraTokens: NgProbeToken[], coreTokens: core.NgProbeToken[]): any {
|
||||
const tokens = (extraTokens || []).concat(coreTokens || []);
|
||||
export function _createNgProbe(coreTokens: core.NgProbeToken[]): any {
|
||||
exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);
|
||||
exportNgVar(CORE_TOKENS_GLOBAL_NAME, {...CORE_TOKENS, ..._ngProbeTokensToMap(tokens || [])});
|
||||
exportNgVar(CORE_TOKENS_GLOBAL_NAME, {...CORE_TOKENS, ..._ngProbeTokensToMap(coreTokens || [])});
|
||||
return () => inspectNativeElement;
|
||||
}
|
||||
|
||||
function _ngProbeTokensToMap(tokens: NgProbeToken[]): {[name: string]: any} {
|
||||
function _ngProbeTokensToMap(tokens: core.NgProbeToken[]): {[name: string]: any} {
|
||||
return tokens.reduce((prev: any, t: any) => (prev[t.name] = t.token, prev), {});
|
||||
}
|
||||
|
||||
|
@ -53,7 +44,6 @@ export const ELEMENT_PROBE_PROVIDERS: core.Provider[] = [
|
|||
provide: core.APP_INITIALIZER,
|
||||
useFactory: _createNgProbe,
|
||||
deps: [
|
||||
[NgProbeToken, new core.Optional()],
|
||||
[core.NgProbeToken, new core.Optional()],
|
||||
],
|
||||
multi: true,
|
||||
|
|
|
@ -11,7 +11,6 @@ export {Meta, MetaDefinition} from './browser/meta';
|
|||
export {Title} from './browser/title';
|
||||
export {disableDebugTools, enableDebugTools} from './browser/tools/tools';
|
||||
export {By} from './dom/debug/by';
|
||||
export {NgProbeToken} from './dom/debug/ng_probe';
|
||||
export {DOCUMENT} from './dom/dom_tokens';
|
||||
export {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager';
|
||||
export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './dom/events/hammer_gestures';
|
||||
|
|
|
@ -82,13 +82,6 @@ export declare type MetaDefinition = {
|
|||
[prop: string]: string;
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
export declare class NgProbeToken {
|
||||
name: string;
|
||||
token: any;
|
||||
constructor(name: string, token: any);
|
||||
}
|
||||
|
||||
/** @stable */
|
||||
export declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef;
|
||||
|
||||
|
|
Loading…
Reference in New Issue