Skip to content

Instantly share code, notes, and snippets.

@jplemieux66
Created June 24, 2018 14:08
Show Gist options
  • Save jplemieux66/7d9b26f0258f49267f59978defb2fdfc to your computer and use it in GitHub Desktop.
Save jplemieux66/7d9b26f0258f49267f59978defb2fdfc to your computer and use it in GitHub Desktop.
import { HttpClient } from '@angular/common/http';
import { Component } from '@angular/core';
import { Observable } from 'rxjs';
import { DataModel } from 'src/data/data.model';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
data: Observable<DataModel>;
constructor(private http: HttpClient) {
this.data = this.http.get<DataModel>('data/data.json');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment