Create a gist now

Instantly share code, notes, and snippets.

@doggy8088 /app.component.html Secret
Last active Feb 5, 2017

What would you like to do?
<pre>{{data|async|json}}</pre>
import {Http} from '@angular/http';
import { Component } from '@angular/core';
import 'rxjs/add/operator/map';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
data: any;
constructor(private http: Http) {
}
ngOnInit() {
let url = 'http://data.taipei/opendata/datalist/apiAccess?scope=resourceAquire&rid=0b544701-fb47-4fa9-90f1-15b1987da0f5';
this.data = this.http.get(url).map(x => x.json());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment