Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit } from ‘@angular/core’;
- import { EthService } from ‘./ethereum/eth.service’;
- @Component({
- selector: ‘app-root’,
- template: ‘<p>Current Account: {{address$ | async}}’,
- styles: []
- })
- export class AppComponent implements OnInit {
- public address$: Observable<string>;
- constructor(private eth: EthService) {}
- ngOnInit() {
- this.address$ = this.eth.currentAccount();
- }
- }
Add Comment
Please, Sign In to add comment