Skip to content

remote-config InjectionTokens miss-match between docs and code. #2645

@mcroker

Description

@mcroker

Version info

AngularFire:
@angular/fire 6.0.0

Other (e.g. Ionic/Cordova, Node, browser, operating system):

Ionic:

Ionic CLI : 5.4.16
Ionic Framework : @ionic/angular 5.3.3
@angular-devkit/build-angular : 0.901.12
@angular-devkit/schematics : 9.1.12
@angular/cli : 9.1.12
@ionic/angular-toolkit : 2.3.0

Capacitor:

Capacitor CLI : 2.4.2
@capacitor/core : 2.4.2

Cordova:

Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available

Utility:

cordova-res : not installed
native-run (update available: 1.2.2) : 1.0.0

System:

ios-deploy : 1.11.0
NodeJS : v12.14.0 (/opt/local/bin/node)
npm : 6.13.4
OS : macOS Catalina
Xcode : Xcode 12.1 Build version 12A7403

How to reproduce these conditions

I believe the putting it all together example in the remote-config readme doesn't align with the code. It references DEFAULT_CONFIG and REMOTE_CONFIG_SETTINGS; whereas in the code these are actually defined as SETTING and DEFAULT. The import statement isn't included in snippet so it could be that they were renamed (but if that's the case I suggest inclusion of the include would help the example.)

https://github.com/angular/angularfire/blob/master/docs/remote-config/getting-started.md

@NgModule({
  imports: [
    AngularFireModule.initializeApp(environment.firebase),
    AngularFireRemoteConfigModule
  ],
  providers: [
    { provide: DEFAULT_CONFIG, useValue: { enableAwesome: true } },
    {
      provide: REMOTE_CONFIG_SETTINGS,
      useFactory: () => isDevMode() ? { minimumFetchIntervalMillis: 10_000 } : {}
    }
  ]
})
export class AppModule { }

https://github.com/angular/angularfire/blob/master/src/remote-config/remote-config.ts

export declare const SETTINGS: InjectionToken<remoteConfig.Settings>;
export declare const DEFAULTS: InjectionToken<ConfigTemplate>;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions