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

Angular Platform

puku0x
February 26, 2019

Angular Platform

FukuokaJS #7

puku0x

February 26, 2019
Tweet

More Decks by puku0x

Other Decks in Technology

Transcript

  1. 8

  2. サービス/プロバイダ 11 @Injectable({ providedIn: 'root' }) export class UserService {

    constructor(private http: HttpClient) {} fetchUsers() { return this.http.get<User[]>('/users'); } }
  3. 12 モジュール機構(NgModule) Root Module Feature Module Shared Module Feature Module

    Feature Module Bootstrap Eager Loaded Lazy Loaded { path: './feature', loadChildren: './feature.module#FeatureModule' } @NgModule({ imports: [SharedModule] }) export class FeatureModule { }
  4. 17

  5. Custom Elementsとして出力 export class AppModule implements DoBootstrap { constructor(injector: Injector)

    { const el = createCustomElement(HelloComponent, { injector }); customElements.define('app-hello', el); } ngDoBootstrap(appRef: ApplicationRef) {} } 21
  6. Angular CLI 23 環境構築 $ ng new コード生成/機能追加 $ ng

    generate $ ng add 開発/リリース $ ng serve $ ng build --prod https://cli.angular.io/
  7. Angularアプリケーションの作成 $ ng new my-app ? Would you like to

    add Angular routing? Yes ? Which stylesheet format would you like to use? (Use arrow keys) ❯ CSS SCSS [ http://sass-lang.com ] SASS [ http://sass-lang.com ] LESS [ http://lesscss.org ] Stylus [ http://stylus-lang.com ] 25
  8. Language Service(VS Code 拡張) 32 • コード補完 • テンプレートチェック •

    定義ジャンプ https://marketplace.visualstudio.com/items?itemName =Angular.ng-template
  9. 33

  10. Bazelビルドサポート $ npm i -g @angular/bazel $ ng new my-app

    --collection=@angular/bazel $ cd my-app $ ng serve $ ng build --prod 48
  11. 49 ngAtlanta 2019: Angular in 2019 http://bit.ly/ngAtlanta-2019 Angular Mix 2018:

    Angular Prototyping Tool http://bit.ly/AngularCodesign