Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added dropdown menu
  • Loading branch information
jos15101 committed Mar 25, 2020
1 parent 7999e27 commit 4e90a82
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/main/main-center/main-center.component.html
Expand Up @@ -13,4 +13,4 @@

<ng-template #noPdf>
<h1 class="ml-4 mt-4 text-danger">PDF not found</h1>
</ng-template>
</ng-template>
32 changes: 25 additions & 7 deletions src/app/main/tree/tree.component.html
@@ -1,7 +1,25 @@
<p-tree [value]="filesTree" selectionMode="single" (onNodeSelect)="nodeSelect($event)">
<ng-template let-node pTemplate="default">
<div class="tree">
<div class="flex-fill">{{ node.label }}</div>
</div>
</ng-template>
</p-tree>
<h2 class="ml-2">Select XA: </h2>

<ng-container *ngIf="selectedXA == ''">
<h4 class="ml-2">Please select a model</h4>
</ng-container>

<select class="ml-2" ng-model="selectedXA" (change)="selectOptionHandler($event)">
<option value="">none</option>
<option value="uconn">UConn</option>
<option value="test">Test</option>
</select>

<ng-container *ngIf="selectedXA == 'test'">
<p class="ml-2">No information is available for selected model</p>
</ng-container>

<ng-container *ngIf="selectedXA == 'uconn'">
<p-tree [value]="filesTree" selectionMode="single" (onNodeSelect)="nodeSelect($event)">
<ng-template let-node pTemplate="default">
<div class="tree">
<div class="flex-fill">{{ node.label }}</div>
</div>
</ng-template>
</p-tree>
</ng-container>
6 changes: 6 additions & 0 deletions src/app/main/tree/tree.component.ts
Expand Up @@ -12,6 +12,12 @@ export class TreeComponent implements OnInit {

filesTree: TreeNode[];

selectedXA = '';

selectOptionHandler(event: any) {
this.selectedXA = event.target.value;
}

constructor(
private treeService: TreeService,
private nodeService: NodeService
Expand Down

0 comments on commit 4e90a82

Please sign in to comment.