Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created October 9, 2018 16:29
Show Gist options
  • Save vsavkin/0f2845c6f40d6bc236353ae720c601c3 to your computer and use it in GitHub Desktop.
Save vsavkin/0f2845c6f40d6bc236353ae720c601c3 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import {Observable} from "rxjs";
import {HttpClient} from "@angular/common/http";
import {Ticket} from "@myorg/data";
@Component({
selector: 'myorg-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
tickets: Observable<Ticket[]>;
constructor(http: HttpClient) {
this.tickets = http.get<Ticket[]>('/api/tickets');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment