Skip to content

Commit c46f746

Browse files
committed
- fixed typo in readme
- made visualisation a bit more clear
1 parent 6317508 commit c46f746

File tree

8 files changed

+27
-6
lines changed

8 files changed

+27
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Plugin Architektura s Webpack5, NX a Angular 14+ (Ivy + AOT)
22
## Jak spustit:
33
1. Vybuildit plugin a widget (mělo by být součástí gitu, lze přeskočit na krok 3.)
4-
1. `npm run build:all`
4+
1. `npm run build:remotes`
55
1. přetáhnout obsah složky `dist/apps` do `apps/shell/assets` (v assets tedy bude složka `plugins` a `widgets`)
66
1. spustit aplikaci pomocí: `nx run shell:serve:production`
77
1. otevřít [aplikaci](http://localhost:4200)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
<p>exposed component from calendar plugin</p>
2-
<p>{{randomService.randomString$ | async}}</p>
2+
<p class="component">
3+
<strong>Sdílený stav aplikace v pluginu:</strong>
4+
{{randomService.randomString$ | async}}
5+
</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:host {
2+
border: 1px dashed red;
3+
border-radius: 1rem;
4+
padding: 1rem;
5+
6+
.component {
7+
display: flex;
8+
flex-direction: column;
9+
}
10+
}

apps/shell/src/app/app.component.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<h1>{{title}}</h1>
2-
<p>{{randomService.randomString$ | async}}</p>
2+
<p class="component">
3+
<strong>Sdílený stav v aplikaci:</strong>
4+
{{randomService.randomString$ | async}}
5+
</p>
36

47
<ul class="remote-menu">
58
<li><a routerLink="/">Home</a></li>

apps/shell/src/app/app.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {Component, OnInit, ViewChild, ViewContainerRef} from '@angular/core';
22
import {loadRemoteModule} from "@nrwl/angular/mf";
33
import {RandomService} from "@ng-mfa/shared/data-access/random";
4-
import {delay} from "rxjs";
54

65
@Component({
76
selector: 'ng-mfa-root',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:host {
2+
border: 1px dashed blue;
3+
border-radius: 1rem;
4+
padding: 1rem;
5+
}

apps/widgets/standalone/src/app/remote-entry/entry.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import { CommonModule } from '@angular/common';
77
imports: [CommonModule],
88
selector: 'ng-mfa-widgets-standalone-entry',
99
templateUrl: './entry.component.html',
10+
styleUrls: ['./entry.component.scss'],
1011
})
1112
export class RemoteEntryComponent {}

libs/shared/data-access/random/src/lib/random.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Injectable, NgModuleRef} from '@angular/core';
2-
import {map, Observable, share, timer} from "rxjs";
2+
import {map, Observable, shareReplay, timer} from "rxjs";
33

44
@Injectable({
55
providedIn: 'root'
@@ -12,7 +12,7 @@ export class RandomService {
1212
this.randomString$ = timer(0, 5000)
1313
.pipe(
1414
map(() => Math.random().toString(36)),
15-
share(),
15+
shareReplay(),
1616
)
1717

1818
}

0 commit comments

Comments
 (0)