Skip to content

Commit

Permalink
#12 show 'not set' if address is 0x00
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzhak committed Oct 26, 2018
1 parent 2a2c8a3 commit c2dbc6a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/app/dashboard/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ <h4>Next episode</h4>
<tbody>
<tr>
<th scope="row">Next host address</th>
<td>{{ nextEpisode.nextShowHost }}</td>
<td>{{ nextEpisode.nextShowHost | readableEmptyValue }}</td>
</tr>
<tr>
<th scope="row">Next guest address</th>
<td>{{ nextEpisode.nextShowGuest }}</td>
<td>{{ nextEpisode.nextShowGuest | readableEmptyValue }}</td>
</tr>
<tr>
<th scope="row">Previous host address</th>
<td>{{ nextEpisode.prevShowHost }}</td>
<td>{{ nextEpisode.prevShowHost | readableEmptyValue }}</td>
</tr>
<tr>
<th scope="row">Previous guest address</th>
<td>{{ nextEpisode.prevShowGuest }}</td>
<td>{{ nextEpisode.prevShowGuest | readableEmptyValue }}</td>
</tr>
<tr>
<th scope="row">Used ad slots</th>
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/pipes/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { ReadableEmptyValuePipe } from './readable-empty-value/readable-empty-value.pipe';
export { ReadableMethodParamPipe } from './readable-method-param/readable-method-param.pipe';
export { ReadableMethodSignPipe } from './readable-method-sign/readable-method-sign.pipe';
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({ name: 'readableEmptyValue' })
export class ReadableEmptyValuePipe implements PipeTransform {

transform(value: string) {
let result = "No data";
if(value == "0x0000000000000000000000000000000000000000") result = "Not set";
return result;
}

}
4 changes: 3 additions & 1 deletion src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { ReadableMethodParamPipe, ReadableMethodSignPipe } from './pipes';
import { ReadableEmptyValuePipe, ReadableMethodParamPipe, ReadableMethodSignPipe } from './pipes';

@NgModule({
imports: [
CommonModule
],
declarations: [
ReadableEmptyValuePipe,
ReadableMethodParamPipe,
ReadableMethodSignPipe
],
exports: [
ReadableEmptyValuePipe,
ReadableMethodParamPipe,
ReadableMethodSignPipe
]
Expand Down

0 comments on commit c2dbc6a

Please sign in to comment.