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

Angular 2, Building a Complete App With Typescript

Jeremy Wilken
September 26, 2015

Angular 2, Building a Complete App With Typescript

Presented for Angular Remote Conf

What you’ll get is a whirlwind tour of an example Angular 2 app. You’ll get to see how many of the Angular 2 concepts can be wired together for a resulting app and how TypeScript and ES6 features are used to enhance the programming experience and app quality.

Jeremy Wilken

September 26, 2015
Tweet

More Decks by Jeremy Wilken

Other Decks in Programming

Transcript

  1. HI, I’M JEREMY Dev at Teradata Live in Austin, TX

    Started using Angular during 0.9 Wrote Ionic in Action Working on Angular 2 book Brews a lot of good beer
  2. ES6 IN A NUTSHELL • New features: classes, modules, promises,

    arrows, generators, and more. • Additive only, doesn’t remove existing features. • Most features can be transpiled to current ES5.
  3. TYPESCRIPT IN A NUTSHELL • Transpiler to compile down to

    ES6/5/3. • Adds strict typings to variables. • Only extends JavaScript syntax.
  4. ES6/TYPESCRIPT PRIMER let  name  =  'Jeremy';   let  template  =

     `   <h1>Template  by  ${name}</h1>   <p>I  can  write  markup  without  escaping  and   write  on  multiple  lines!</p>   `; ES6 inline multiline template strings
  5. ES6/TYPESCRIPT PRIMER let  stocks  =  ['aapl',  'goog',  'fb',  'amzn'];  

    class  Dashboard  {      constructor()  {          stocks.forEach(stock  =>  {              this.add(stock.toUpperCase());          });      }      add(stock)  {          this.stocks.push(stock);      }   } ES6 arrow functions
  6. ES6/TYPESCRIPT PRIMER class  Dashboard  {      constructor(service)  {  

           this.symbols  =  service.get();      }          reset()  {          this.symbols  =  [];      }   } ES6 classes
  7. ES6/TYPESCRIPT PRIMER import  {service}  from  './service';   export  class  Dashboard

     {      constructor()  {          this.symbols  =  service.get();      }   } ES6 modules
  8. ES6/TYPESCRIPT PRIMER @Component({      selector:  'app'   })  

    export  class  App  {   } ES7 decorators
  9. ES6/TYPESCRIPT PRIMER interface  StockInterface  {      symbol:  string,  

       lastTradePriceOnly:  number,      change:  number,      changeInPercent:  number   }   let  stocks:  Array<StockInterface>  =  []; Typescript interfaces and type declarations
  10. ANGULAR 2 IN ACTION https://github.com/angular-in-action/hello-world Remember, Angular 2 is in

    flux. That said, the concepts and general approaches are pretty solid.