diff --git a/web-ui/src/app/app.module.ts b/web-ui/src/app/app.module.ts index 283ca0d..6637fb0 100644 --- a/web-ui/src/app/app.module.ts +++ b/web-ui/src/app/app.module.ts @@ -14,6 +14,7 @@ import { NgHttpLoaderModule } from 'ng-http-loader/ng-http-loader.module' import { ErrorService } from './services/error.service'; import { LanguageService } from './services/language.service'; +import { NavigatorService } from './services/navigator.service'; import { NotificationService } from './services/notification.service'; import { TransactionsService } from './services/transactions.service'; @@ -53,6 +54,7 @@ import { TransactionFinderComponent } from './components/transaction-finder/tran providers: [ ErrorService, LanguageService, + NavigatorService, NotificationService, TransactionsService ], diff --git a/web-ui/src/app/services/navigator.service.ts b/web-ui/src/app/services/navigator.service.ts new file mode 100644 index 0000000..1c1544a --- /dev/null +++ b/web-ui/src/app/services/navigator.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; + +import { Router } from '@angular/router'; + +@Injectable() +export class NavigatorService { + + constructor(private router: Router) { } + + go(path: string) { + this.router.navigate([path]); + } + + transactionDetails(txid: string) { + this.go('/transactions/' + txid); + } +}