Browse Source

web-ui: Add NavigatorService

scalafmt-draft
Alexis Hernandez 7 years ago
parent
commit
1e2461c8c9
  1. 2
      web-ui/src/app/app.module.ts
  2. 17
      web-ui/src/app/services/navigator.service.ts

2
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
],

17
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);
}
}
Loading…
Cancel
Save