Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Angular 2 @ JS Ojisan #6-3

Angular 2 @ JS Ojisan #6-3

JS オジサン #6-3 での Angular 2 のざっくりした紹介です。
https://atnd.org/events/71991

Shuhei Kagawa

December 17, 2015
Tweet

More Decks by Shuhei Kagawa

Other Decks in Programming

Transcript

  1. ߳઒ पฏ > Rails, Angular, Node ͳͲͷΦδαϯ @M3, Inc. 10k

    LOC Angular App > GitHub, npm, Qiita @shuhei > Twitter @shuheikagawa > Ϗʔϧݕఆ 2 ڃ !
  2. !

  3. TYPESCRIPT @Component({ selector: 'hello-world', template: '<p>{{ greeting }}, {{ name

    }}!</p>', inputs: ['greeting', 'name'] }) export class HelloWorld {}
  4. SCOPED CSS // my-app.ts @Component({ // ... templateUrl: 'my-app.html', styleUrls:

    ['my-app.css'] }) export class MyApp {} /* my-app.css */ h3 { margin: 2rem 0; }
  5. ίʔυ @Component({ selector: 'my-app', templateUrl: 'app/my-app.html', styleUrls: ['app/my-app.css'] }) export

    class MyApp { searchText = new Control(); repos: any; constructor(private github: GitHubService) { this.repos = this.searchText.valueChanges .debounceTime(300) .flatMap(text => this.github.search(text)); } }
  6. <h3>GitHub repositoy search</h3> <p> <input [ngFormControl]="searchText" placeholder="keyword" class="form-control"> </p> <ul

    class="repositories"> <li *ngFor="#repo of repos | async"> <a [href]="repo.html_url">{{repo.full_name}}</a> {{repo.stargazers_count}} stars </li> </ul>
  7. ඈͼಓ۩ʂ > DOM ૢ࡞Ҏ֎͕ Web Worker Ͱಈ͘ʂ > αʔόαΠυϨϯμϦϯάʂ Angular

    Universal > ωΠςΟϒΞϓϦʂ React Native, NativeScript
  8. $ ng new js-ojisan $ cd js-ojisan $ ls -l

    total 32 drwxr-xr-x 10 shuhei staff 340 Dec 16 11:44 dist -rw-r--r-- 1 shuhei staff 200 Dec 16 09:44 ember-cli-build.js -rw-r--r-- 1 shuhei staff 1282 Dec 16 09:44 karma-test-shim.js -rw-r--r-- 1 shuhei staff 1365 Dec 16 09:44 karma.conf.js drwxr-xr-x 17 shuhei staff 578 Dec 16 09:44 node_modules -rw-r--r-- 1 shuhei staff 571 Dec 16 09:44 package.json drwxr-xr-x 7 shuhei staff 238 Dec 16 09:44 src drwxr-xr-x 26 shuhei staff 884 Dec 16 21:16 tmp $ ng serve $ open http://localhost:4200
  9. > Angular 2: One framework > AngularClass/awesome-angular2 - GitHub >

    AngularConnect 2015 Videos - Youtube > Angular 2 Advent Calendar 2015 - Qiita
  10. CREDITS > Angular: One framework > Comparing Performance of Blaze,

    React, Angular-Meteor and Angular 2 with Meteor by Shawn McKay > snack by liz west