Skip to content

Instantly share code, notes, and snippets.

@GrandSchtroumpf
Created August 23, 2018 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GrandSchtroumpf/9649b1863f5f9c84ab5c2cf780358f97 to your computer and use it in GitHub Desktop.
Save GrandSchtroumpf/9649b1863f5f9c84ab5c2cf780358f97 to your computer and use it in GitHub Desktop.
@ngeth in your component
import { Component, OnInit } from '@angular/core';
import { Eth } from '@ngeth/provider';
import { Observable } from 'rxjs';
@Component({
selector: 'app-root',
template: '<h1>Current Block : {{ block$ | async }}</h1>',
styles: []
})
export class AppComponent implements OnInit {
public block$: Observable<string>;
constructor(private eth: Eth) {}
ngOnInit() {
this.block$ = this.eth.getBlockNumber();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment