src/client/app/modules/sample/services/name-list.service.ts
Properties |
|
Methods |
constructor(analytics: AnalyticsService, http: Http)
|
getNames |
getNames()
|
Returns :
Observable<>
|
Public analytics |
analytics:
|
Type : AnalyticsService
|
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { Config } from '../../core/index';
import { Analytics, AnalyticsService } from '../../analytics/index';
import { NameList } from '../actions/index';
@Injectable()
export class NameListService extends Analytics {
constructor(
public analytics: AnalyticsService,
private http: Http
) {
super(analytics);
this.category = NameList.CATEGORY;
}
getNames(): Observable<Array<string>> {
return this.http.get(`${Config.IS_MOBILE_NATIVE() ? '/' : ''}assets/data.json`)
.map(res => res.json());
}
}