<commit_before>import { Injectable } from "@angular/core";
import { Http } from '@angular/http';

import 'rxjs/add/operator/toPromise';
import { HomeModel } from "./home.model";
import { LogServiceProvider } from '../../providers/log-service/log-service';
import { Constants } from "../../app/app.contants";


@Injectable()
export class HomeService {
  constructor(public http: Http, public log: LogServiceProvider) {}

  // getData(): Promise<HomeModel> {
  //   return this.http.get(Constants.URL + '/api/homes')
  //    .toPromise()
  //    .then(response => response.json() as HomeModel)
  //    .catch(this.handleError);
  // }

  getData(): Promise<HomeModel> {
    return this.http.get('./assets/example_data/home.json')
     .toPromise()
     .then(response => response.json() as HomeModel)
     .catch(this.handleError);
  }

  private handleError(error: any): Promise<any> {
    this.log.errorService('An error occurred', error); // for demo purposes only<commit_msg>plug server of homeService<commit_after>import { Injectable } from "@angular/core";
import { Http } from '@angular/http';

import 'rxjs/add/operator/toPromise';
import { HomeModel } from "./home.model";
import { LogServiceProvider } from '../../providers/log-service/log-service';
import { Constants } from "../../app/app.contants";


@Injectable()
export class HomeService {
  constructor(public http: Http, public log: LogServiceProvider) {}

  // getData(): Promise<HomeModel> {
  //   return this.http.get(Constants.URL + '/api/homes')
  //    .toPromise()
  //    .then(response => response.json() as HomeModel)
  //    .catch(this.handleError);
  // }

  getData(): Promise<HomeModel> {
    return this.http.get('http://localhost:3000/api/dataofcategories')
     .toPromise()
     .then(response => response.json() as HomeModel)
     .catch(this.handleError);
  }

  private handleError(error: any): Promise<any> {
    this.log.errorService('An error occurred', error); // for demo purposes only
{'fraction_non_alphanumeric': 0.16835187057633974, 'fraction_numerical': 0.0020222446916076846, 'mean_word_length': 3.5704387990762125, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4127530', 'n_tokens_mistral': 606, 'n_tokens_neox': 600, 'n_words': 132}