target router

This commit is contained in:
insanity 2018-04-29 21:13:21 +09:00
parent b61f203500
commit 40a075fc02
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@
<p-panel [showHeader]="false"> <p-panel [showHeader]="false">
<div class="ui-g form-group ui-key-value"> <div class="ui-g form-group ui-key-value">
<of-key-value [key]="'ID'" [value]="sensor.id"></of-key-value> <of-key-value [key]="'ID'" [value]="sensor.id"></of-key-value>
<of-key-value [key]="'Location'" [value]="sensor.target.displayName" [clickable]="true" (click)="onTargetClick($event)" ></of-key-value> <of-key-value [key]="'Location'" [value]="sensor.target.displayName" [clickable]="true" (click)="onTargetClick(sensor.target)" ></of-key-value>
<of-key-value [key]="'Description'" [value]="sensor.description"></of-key-value> <of-key-value [key]="'Description'" [value]="sensor.description"></of-key-value>
<of-key-value [key]="'Crawler Type'" [value]="sensor.crawler.name"></of-key-value> <of-key-value [key]="'Crawler Type'" [value]="sensor.crawler.name"></of-key-value>
<of-key-value [key]="'Sensor Items'" [value]="sensor.itemCount"></of-key-value> <of-key-value [key]="'Sensor Items'" [value]="sensor.itemCount"></of-key-value>

View File

@ -70,7 +70,8 @@ export class DetailComponent implements OnInit, AfterContentInit, OnDestroy {
}); });
} }
onTargetClick(event) { onTargetClick(target) {
this.router.navigate(['sensors'], { queryParams: { target: target.id } });
} }
} }