Commit 6df98e85 authored by 神楽坂玲奈's avatar 神楽坂玲奈

apps service

parent f20a7085
import { Injectable } from '@angular/core'; import {Injectable} from '@angular/core';
import { Http,Response } from '@angular/http'; import {Http} from '@angular/http';
//import { Observable } from 'rxjs';
//import 'rxjs/add/operator/map'
import 'rxjs/Rx'; import 'rxjs/Rx';
@Injectable() @Injectable()
export class AppsService { export class AppsService {
constructor(private http: Http) {} constructor(private http: Http) {
data = ''; }
data = '';
getApps() { getApps() {
console.log(123); console.log(123);
this.http.get('./apps.json').map((res) => {console.log(res)})//.subscribe(res => this.data = res); this.http.get('./apps.json')
.map(response => response.json())
.subscribe(data => this.data = data);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment