Skip to content

Commit e03d44a

Browse files
committed
Add empty in the list
1 parent e93eedb commit e03d44a

File tree

4 files changed

+45
-6
lines changed

4 files changed

+45
-6
lines changed

apps/codelab/src/app/admin/content/presentation-editor/services/content.service.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export class ContentService implements OnDestroy {
2626
map((doc: any) => {
2727
console.log('update');
2828
return doc?.presentations || [];
29-
})
29+
}),
30+
take(1),
3031
);
3132
private readonly localActions$ = new Subject();
3233
readonly allActions$ = merge(
@@ -45,7 +46,6 @@ export class ContentService implements OnDestroy {
4546

4647
public readonly state$ = this.allActions$.pipe(
4748
scan((state: ContentPresentation[], action: any) => {
48-
console.log('aAaaa');
4949
return reducer(state, action);
5050
}, {}),
5151
shareReplay(1),
@@ -237,7 +237,6 @@ export class ContentService implements OnDestroy {
237237
}
238238

239239
saveState(presentations) {
240-
console.log('save');
241240
setDoc(this.presentationDoc, {presentations});
242241
}
243242
}

apps/codelab/src/app/admin/content/presentation-list/presentation-list.component.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@
1919
</button>
2020
</div>
2121

22-
<a *ngIf="presentation.slides[0] as slide" class="first-slide"
22+
<a class="first-slide"
2323
mat-list-item
2424
[routerLink]="'./' + presentation.id + '/0'">
25+
<ng-container *ngIf="presentation.slides[0] as slide else empty">
2526
<slides-small-slide-preview
2627
class="medium"
2728
mode="preview"
2829
[slide]="slide"
2930
></slides-small-slide-preview>
31+
</ng-container>
32+
<ng-template #empty>
33+
No value
34+
</ng-template>
3035
</a>
3136
</div>
3237
</mat-nav-list>

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
"postinstall": "ngcc --properties es2015 browser module main"
5050
},
5151
"husky": {
52-
"hooks": {
53-
}
52+
"hooks": {}
5453
},
5554
"repository": {
5655
"type": "git",
@@ -90,6 +89,7 @@
9089
"husky": "^4.3.8",
9190
"immer": "^5.3.6",
9291
"inquirer": "^8.2.4",
92+
"jsondiffpatch": "^0.4.1",
9393
"medium-editor": "^5.23.3",
9494
"mocha": "^7.2.0",
9595
"monaco-editor": "^0.34.1",

0 commit comments

Comments
 (0)