Guest User

Untitled

a guest
Mar 23rd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import { Component, OnInit } from ‘@angular/core’;
  2. import { EthService } from ‘./ethereum/eth.service’;
  3.  
  4. @Component({
  5. selector: ‘app-root’,
  6. template: ‘<p>Current Account: {{address$ | async}}’,
  7. styles: []
  8. })
  9. export class AppComponent implements OnInit {
  10.  
  11. public address$: Observable<string>;
  12.  
  13. constructor(private eth: EthService) {}
  14.  
  15. ngOnInit() {
  16. this.address$ = this.eth.currentAccount();
  17. }
  18. }
Add Comment
Please, Sign In to add comment