Skip to content

refactor(angular): remove Config.set #22918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ This is a comprehensive list of the breaking changes introduced in the major ver
* [Toolbar](#toolbar)
- [Config](#config)
* [Transition Shadow](#transition-shadow)
- [Angular](#angular)
* [Config Provider](#config-provider)



Expand Down Expand Up @@ -64,6 +66,14 @@ var(--ion-toolbar-background, var(--ion-color-step-50, #f7f7f7));
The `experimentalTransitionShadow` config option has been removed. The transition shadow is now enabled when running in `ios` mode.


### Angular

#### Config Provider

The `Config.set()` method has been removed. See https://ionicframework.com/docs/angular/config for examples on how to set config globally, per-component, and per-platform.




## Version 5.x

Expand Down
8 changes: 0 additions & 8 deletions angular/src/providers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ export class Config {
}
return 0;
}

set(key: keyof IonicConfig, value?: any) {
console.warn(`[DEPRECATION][Config]: The Config.set() method is deprecated and will be removed in Ionic Framework 6.0. Please see https://ionicframework.com/docs/angular/config for alternatives.`);
const c = getConfig();
if (c) {
c.set(key, value);
}
}
}

export const ConfigToken = new InjectionToken<any>('USERCONFIG');
Expand Down
2 changes: 1 addition & 1 deletion angular/test/test-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { AlertComponent } from './alert/alert.component';
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
IonicModule.forRoot(),
IonicModule.forRoot({ keyboardHeight: 12345 }),
],
entryComponents: [
ModalExampleComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class ProvidersComponent {

// test config
this.isTesting = config.getBoolean('_testing');
config.set('keyboardHeight', 12345);
this.keyboardHeight = config.getNumber('keyboardHeight');

zone.runOutsideAngular(() => {
Expand Down