|
@@ -4,6 +4,7 @@ import {
|
|
|
QueryList,
|
|
|
TemplateRef,
|
|
|
ViewChildren,
|
|
|
+ ViewChild,
|
|
|
} from '@angular/core';
|
|
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
|
import { DataService } from 'src/services/data/data.service';
|
|
@@ -23,6 +24,9 @@ export class CharacterPickerComponent {
|
|
|
@ViewChildren(CharacterCardComponent)
|
|
|
characterCards!: QueryList<CharacterCardComponent>;
|
|
|
|
|
|
+ @ViewChild('warning') warning!: TemplateRef<any>;
|
|
|
+
|
|
|
+ // @ViewChildren(warning) warning!: TemplateRef<any>;
|
|
|
public constructor(public dataService: DataService, private Router: Router) {
|
|
|
this.dataService.dataLoaded = false;
|
|
|
this.dataService.getCollection('characters').then((characters: any) => {
|
|
@@ -30,6 +34,10 @@ export class CharacterPickerComponent {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ ngAfterViewInit() {
|
|
|
+ this.showWarning(this.warning);
|
|
|
+ }
|
|
|
+
|
|
|
public addCharacter() {
|
|
|
this.Router.navigate(['character/creator']);
|
|
|
}
|
|
@@ -67,4 +75,8 @@ export class CharacterPickerComponent {
|
|
|
sessionStorage.setItem('characterName', character.name);
|
|
|
this.Router.navigate(['journal']);
|
|
|
}
|
|
|
+
|
|
|
+ showWarning(warning: TemplateRef<any>) {
|
|
|
+ this.modalService.open(warning, { ariaLabelledBy: 'modal-basic-title' });
|
|
|
+ }
|
|
|
}
|