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

Rise with Angular

Rise with Angular

Find Google Slides @ https://bit.ly/rise-with-ng

Hardik Pithva

August 19, 2017
Tweet

More Decks by Hardik Pithva

Other Decks in Technology

Transcript

  1. Day outline • Angular ◦ Architecture ◦ Application Structure ◦

    Setup • Typescript ◦ Features ◦ TS to JS ◦ Demo • Movie App ◦ Display list of movies ◦ Deploy app to firebase
  2. What is Angular? • Ground-up rewrite of AngularJS • TypeScript-based

    open-source platform • Component-based architecture • Web, Mobile and Desktop • Mobile native apps
  3. Features • Component & Directives • Templates • Services •

    Databinding • Pipes • Cross Platform ◦ PWA ◦ Native ◦ Desktop • Universal • CLI • Accessibility
  4. • Hierarchy of components as it’s component-based • "[ ]"

    for property binding, • "( )" for event binding • TypeScript • Reactive programming support using RxJS Angular vs. AngularJS • $scope, $rootScope or controllers • ng-model, ng-bind, etc • ng-click, ng-change, etc • JavaScript or ES6 • No support
  5. Directives Component : a directive with a template Structural :

    a directive that changes DOM layout by adding or removing the elements Attribute : a directive that change the appearance/behavior of an element <movie> *ngIf ngModel
  6. {} <> {} {} • Modules • Components • Templates

    • Metadata • Data binding • Directives • Services • DI
  7. What is TypeScript? • Open source programming language by Microsoft

    • Strict superset of JavaScript • Compatibility with JavaScript • Designed for development of large applications.
  8. Features • Basic Types • Interfaces • Classes • Functions

    • Generics • Enums • Symbols • Iterators and Generators • Triple-Slash Directives • Decorators
  9. “My favorite feature is that the type system mimics the

    actual JS spec as well as the common JS practices in the community very closely, and so it feels very natural to use.” Miško Hevery
  10. Application structure • app ◦ core ◦ components ◦ shared

    • [root-files] <project root> app core core.module.ts exception.service.ts|spec.ts movies movie movie.component.ts|html|css|spec.ts shared movie-button.ts|html|css|spec.ts movie.model.ts movie.service.ts|spec.ts movies.component.ts|html|css|spec.ts movies.module.ts movies-routing.module.ts shared shared.module.ts Init-caps.pipe.ts|spec.ts seasons season … shared ... app.component.ts|html|css|spec.ts app.module.ts app-routing.module.ts main.ts index.html
  11. Configuration files • package.json ◦ identifies npm package dependencies for

    the project. • tsconfig.json ◦ defines how the TypeScript compiler generates JavaScript from the project's files. • systemjs.config.js ◦ provides information to a module loader about where to find application modules, and registers all the necessary packages. bit.ly/ng-config-systemjs
  12. v4.x.x • Smaller & Faster • Enhanced *ngIf and *ngFor

    • TypeScript 2.1 and 2.2 compatibility • Source Maps for Templates • Angular Universal • Packaging Changes
  13. Enhanced *ngIf and *ngFor • Use an if/else style syntax,

    and assign local variables such as when unrolling an observable.