@wertzui/ngx-restworld-client 3.4.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,36 @@
1
- import { HttpBackend } from "@angular/common/http";
2
1
  import { ClientSettings } from "../models/client-settings";
3
2
  import { RESTworldClientCollection } from "./restworld-client-collection";
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class SettingsService {
6
5
  private _clients;
7
- private readonly _client;
8
- private _settings;
6
+ private static _settings;
9
7
  get settings(): ClientSettings | undefined;
10
8
  private initializing;
11
9
  private initialized;
12
- constructor(backend: HttpBackend, _clients: RESTworldClientCollection);
10
+ constructor(_clients: RESTworldClientCollection);
13
11
  ensureInitialized(): Promise<void>;
14
- private loadSettings;
12
+ /**
13
+ * Call this method in your main.ts before calling bootstrapModule(...)
14
+ *
15
+ * Example:
16
+ * async function main() {
17
+ * try {
18
+ * await SettingsService.ensureSettingsAreLoaded();
19
+ *
20
+ * const providers : StaticProvider[] = [
21
+ * { provide: 'BASE_URL', useFactory: getBaseUrl, deps: [] }
22
+ * ];
23
+ *
24
+ * await platformBrowserDynamic(providers).bootstrapModule(AppModule);
25
+ * }
26
+ * catch (e) {
27
+ * console.error(e);
28
+ * }
29
+ * }
30
+ *
31
+ * main();
32
+ * */
33
+ static ensureSettingsAreLoaded(): Promise<void>;
15
34
  private populateRESTworldClientCollectionFromSettings;
16
35
  static ɵfac: i0.ɵɵFactoryDeclaration<SettingsService, never>;
17
36
  static ɵprov: i0.ɵɵInjectableDeclaration<SettingsService>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wertzui/ngx-restworld-client",
3
- "version": "3.4.0",
3
+ "version": "4.0.0",
4
4
  "author": "wertzui",
5
5
  "description": "An Angular client to consume a RESTworld service that serves application/hal+json or hal-forms+json.",
6
6
  "publishConfig": {