Skip to content

Instantly share code, notes, and snippets.

@doggy8088
Last active February 5, 2017 09:14
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 doggy8088/b0727809034215bcd3b781320cece455 to your computer and use it in GitHub Desktop.
Save doggy8088/b0727809034215bcd3b781320cece455 to your computer and use it in GitHub Desktop.
<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