<commit_before>/// <reference path="../typings/_custom.d.ts" />

/*
 * TODO: use the real App component
 * change `app-simple.js` to `app.js` in src/public/index.html
 */

/*
 * Angular 2 decorators and servces
 */
import {Directive, Component, View, ViewEncapsulation, Http} from 'angular2/angular2';
import {RouteConfig, Router} from 'angular2/router';

/*
 * Angular Directives
 */
import {coreDirectives, formDirectives} from 'angular2/angular2';
import {routerDirectives} from 'angular2/router';

/*
 * App Component
 * Top Level Component
 */
@Component({
  selector: 'app'
})
@View({
  encapsulation: ViewEncapsulation.EMULATED,
  // needed in order to tell Angular's compiler what's in the template
  directives: [ coreDirectives, formDirectives, routerDirectives ],
  template: `
  <style>
    .title { font-family: Arial, Helvetica, sans-serif; }
  </style>

  <header>
    <h1 class="title">Hello {{ name }}</h1>
  </header>

  <main>
    Your Content Here
    <div>
      <input type="text" [(ng-model)]="name" autofocus>
    </div>
    <pre>data = {{ data | json }}</pre>
  </main>

  <footer>
    WebPack Angular 2 Starter by <a href="https://twitter.com/AngularClass">@AngularClass</a>
  </footer>
  `
})
export class App {
  name: string;
  data: Array<any> = []; // default data
  constructor(public http: Http) {
    this.name = 'Angular 2';
    this.getData();
  }
  getData() {
    // npm install express connect-history-api-fallback morgan body-parser
    // npm run express

    // var headers = new Headers();

    this.http.
      get('/api/todos', {
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json'
        }
      }).
      toRx().
      map(res => res.json()).
      subscribe(
        // onNext value
        data => this.serverData(data),
        // onError
        err  => this.errorMessage(err)
      );//end http
  }

  serverData(data) {
    console.log('data', data);
    this.data = data;
  }
  errorMessage(err) {
    if (err && (/Unexpected token/).test(err.message)) {
      console.info(`${'\n'
        } // You must run these commands for the Http API to work ${'\n'
        } npm install express connect-history-api-fallback morgan body-parser ${'\n'
        } npm run express
      `);
    }//end err.message
  }
}
<commit_msg>style(app-simple): remove comment<commit_after>/// <reference path="../typings/_custom.d.ts" />

/*
 * TODO: use the real App component
 * change `app-simple.js` to `app.js` in src/public/index.html
 */

/*
 * Angular 2 decorators and servces
 */
import {Directive, Component, View, ViewEncapsulation, Http} from 'angular2/angular2';
import {RouteConfig, Router} from 'angular2/router';

/*
 * Angular Directives
 */
import {coreDirectives, formDirectives} from 'angular2/angular2';
import {routerDirectives} from 'angular2/router';

/*
 * App Component
 * Top Level Component
 */
@Component({
  selector: 'app'
})
@View({
  encapsulation: ViewEncapsulation.EMULATED,
  // needed in order to tell Angular's compiler what's in the template
  directives: [ coreDirectives, formDirectives, routerDirectives ],
  template: `
  <style>
    .title { font-family: Arial, Helvetica, sans-serif; }
  </style>

  <header>
    <h1 class="title">Hello {{ name }}</h1>
  </header>

  <main>
    Your Content Here
    <div>
      <input type="text" [(ng-model)]="name" autofocus>
    </div>
    <pre>data = {{ data | json }}</pre>
  </main>

  <footer>
    WebPack Angular 2 Starter by <a href="https://twitter.com/AngularClass">@AngularClass</a>
  </footer>
  `
})
export class App {
  name: string;
  data: Array<any> = []; // default data
  constructor(public http: Http) {
    this.name = 'Angular 2';
    this.getData();
  }
  getData() {
    // npm install express connect-history-api-fallback morgan body-parser
    // npm run express

    this.http.
      get('/api/todos', {
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json'
        }
      }).
      toRx().
      map(res => res.json()).
      subscribe(
        // onNext value
        data => this.serverData(data),
        // onError
        err  => this.errorMessage(err)
      );//end http
  }

  serverData(data) {
    console.log('data', data);
    this.data = data;
  }
  errorMessage(err) {
    if (err && (/Unexpected token/).test(err.message)) {
      console.info(`${'\n'
        } // You must run these commands for the Http API to work ${'\n'
        } npm install express connect-history-api-fallback morgan body-parser ${'\n'
        } npm run express
      `);
    }//end err.message
  }
}

{'fraction_non_alphanumeric': 0.15676959619952494, 'fraction_numerical': 0.004750593824228029, 'mean_word_length': 2.6558800315706392, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 47, 'https://': 2, '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': '4700694', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1489, 'n_words': 384}