@ng-desktop/router 0.4.0 → 0.5.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.
- package/README.md +47 -8
- package/fesm2022/platform-location.js +3 -3
- package/fesm2022/route-strategies.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@ng-desktop/router`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Native in-memory `PlatformLocation` (`NativePlatformLocation`), route reuse strategy, and window title synchronization enabling `@angular/router` (`<router-outlet />`, `routerLink`, `withComponentInputBinding`, guards, and lazy routes) without a browser URL bar.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
5
|
+
## Install
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
pnpm add @ng-desktop/router
|
|
8
|
+
pnpm add @ng-desktop/router @ng-desktop/platform
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `@angular/core >= 22.0.0`, `@angular/router >= 22.0.0`, `@ng-desktop/platform`.
|
|
12
|
+
|
|
13
|
+
## Quick Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { ApplicationConfig } from '@angular/core';
|
|
17
|
+
import {
|
|
18
|
+
provideNativeRouter,
|
|
19
|
+
withComponentInputBinding,
|
|
20
|
+
withNativeTitleStrategy,
|
|
21
|
+
} from '@ng-desktop/router';
|
|
22
|
+
import { appRoutes } from './app.routes';
|
|
23
|
+
|
|
24
|
+
export const appConfig: ApplicationConfig = {
|
|
25
|
+
providers: [
|
|
26
|
+
provideNativeRouter(appRoutes, withComponentInputBinding()),
|
|
27
|
+
withNativeTitleStrategy('My Desktop App'),
|
|
28
|
+
],
|
|
29
|
+
};
|
|
11
30
|
```
|
|
12
31
|
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
Inside your root template:
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<ng-window id="win" title="My Desktop App">
|
|
36
|
+
<ng-box orientation="vertical" spacing="12px">
|
|
37
|
+
<ng-button routerLink="/items">Catalog</ng-button>
|
|
38
|
+
<router-outlet />
|
|
39
|
+
</ng-box>
|
|
40
|
+
</ng-window>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Key Exports
|
|
44
|
+
|
|
45
|
+
- `provideNativeRouter`, `NativePlatformLocation`
|
|
46
|
+
- `withNativeTitleStrategy`, `NativeTitleStrategy`, `NATIVE_TITLE_PREFIX`
|
|
47
|
+
- `withNativeRouteReuse`, `NativeStackRouteReuseStrategy`
|
|
48
|
+
- Re-exported Angular router primitives: `Router`, `RouterOutlet`, `RouterLink`, `RouterLinkActive`, `ActivatedRoute`, `withComponentInputBinding`
|
|
49
|
+
|
|
50
|
+
## Documentation
|
|
51
|
+
|
|
52
|
+
- [Getting Started with External Angular 22+ & Nx Apps](../../docs/GETTING_STARTED.md)
|
|
53
|
+
- [Architectural Roadmap & OS Maturity Matrix](../../ROADMAP.md)
|
|
@@ -145,10 +145,10 @@ export class NativePlatformLocation extends PlatformLocation {
|
|
|
145
145
|
}
|
|
146
146
|
return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
|
|
147
147
|
}
|
|
148
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
149
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.
|
|
148
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativePlatformLocation, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
149
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativePlatformLocation, providedIn: 'root' });
|
|
150
150
|
}
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativePlatformLocation, decorators: [{
|
|
152
152
|
type: Injectable,
|
|
153
153
|
args: [{ providedIn: 'root' }]
|
|
154
154
|
}] });
|
|
@@ -20,10 +20,10 @@ export class NativeTitleStrategy extends TitleStrategy {
|
|
|
20
20
|
this.titleService.setTitle(resolved);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
24
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeTitleStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
24
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeTitleStrategy, providedIn: 'root' });
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeTitleStrategy, decorators: [{
|
|
27
27
|
type: Injectable,
|
|
28
28
|
args: [{ providedIn: 'root' }]
|
|
29
29
|
}] });
|
|
@@ -107,10 +107,10 @@ export class NativeStackRouteReuseStrategy {
|
|
|
107
107
|
}
|
|
108
108
|
return route.routeConfig?.path ?? '';
|
|
109
109
|
}
|
|
110
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
111
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.
|
|
110
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeStackRouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
111
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeStackRouteReuseStrategy, providedIn: 'root' });
|
|
112
112
|
}
|
|
113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeStackRouteReuseStrategy, decorators: [{
|
|
114
114
|
type: Injectable,
|
|
115
115
|
args: [{ providedIn: 'root' }]
|
|
116
116
|
}] });
|