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

Micro-Apps and Angular Elements -- Talk from ng...

Avatar for Manfred Steyer Manfred Steyer
September 04, 2018
230

Micro-Apps and Angular Elements -- Talk from ngMunich, Sep. 2018

Contents:
- Micro Apps
- Web Components/ Custom Elements
- Implementing Micro Apps with Angular Elements
- DEMO
- Recipes

# Samples
https://github.com/manfredsteyer/Angular_MicroApps_Different_Technologies

# More Information and Workshops:
https://www.softwarearchitekt.at

Avatar for Manfred Steyer

Manfred Steyer

September 04, 2018
Tweet

More Decks by Manfred Steyer

Transcript

  1. @ManfredSteyer About me… • Manfred Steyer • SOFTWAREarchitekt.at • Angular

    Trainings and Consultancy • Google Developer Expert (GDE) Page ▪ 2 Manfred Steyer Public: Munich, November 2018 Early-Bird Tickets available now! Discount Code: ngMunich (15%) In-House: everywhere http://www.softwarearchitekt.at/workshops
  2. @ManfredSteyer ✓ Commodore 64 ✓ 1982 ✓ ~ 1 MHz

    ✓ 64 KB RAM ✓ Disks with 170 KB
  3. @ManfredSteyer µService Providing a (SPA based) Shell µApp µApp µApp

    Shell ✓ iframes ✓ Bootstrapping several SPAs ✓ Web Components
  4. @ManfredSteyer Custom Elements Custom HTML-Element, e. g. <date-picker> Behaves like

    build-in ones Write once; consume with any framework Can be polyfilled for all current browser
  5. @ManfredSteyer Shadow DOM Isolate CSS Parent cannot influence Component's layout

    Component cannot influence Parent or Siblings Can be emulated for all current browsers (w/ limitations)
  6. @ManfredSteyer µService µApp3 µApp2 µApp1 Shell Web Components for Macro-Architecture

    Shared Widget Shared Widget Shared Widget Web Components for Micro-Architecture
  7. @ManfredSteyer Shadow DOM • Baked-in • Emulation • @Component({ encapsulation:

    ViewEncapsulation.Emulated }) • Default • Shadow DOM • @Component({ encapsulation: ViewEncapsulation.Native }) • Can be turned off: • @Component({ encapsulation: ViewEncapsulation.None })
  8. @ManfredSteyer MicroApp as Angular Elements @NgModule({ imports: [BrowserModule], declarations: [MicroAppComponent],

    bootstrap: [], entryComponents: [MicroAppComponent] }) export class AppModule { }
  9. @ManfredSteyer MicroApp as Angular Elements @NgModule({ imports: [BrowserModule], declarations: [MicroAppComponent],

    bootstrap: [], entryComponents: [MicroAppComponent] }) export class AppModule { }
  10. @ManfredSteyer MicroApp as Angular Elements @NgModule({ imports: [BrowserModule], declarations: [MicroAppComponent],

    bootstrap: [], entryComponents: [MicroAppComponent] }) export class AppModule { constructor(private injector: Injector) { } ngDoBootstrap() { } }
  11. @ManfredSteyer MicroApp as Angular Elements @NgModule({ imports: [BrowserModule], declarations: [MicroAppComponent],

    bootstrap: [], entryComponents: [MicroAppComponent] }) export class AppModule { constructor(private injector: Injector) { } ngDoBootstrap() { const MicroAppElement = createCustomElement( MicroAppComponent, { injector: this.injector }); customElements.define('micro-app', MicroAppElement); } }
  12. @ManfredSteyer Blog > SOFTWAREarchitekt.at • A Software Architect's Approach Towards

    Using Angular (And SPAs In General) For Microservices Aka Microfrontends • Micro Apps With Web Components Using Angular Elements • Angular Elements: A dynamic Dashboard … • Angular, React, Vue.Js And Co. Peacefully United Thanks To Micro Apps And Web Components
  13. @ManfredSteyer Contact and Downloads [mail] [email protected] [web] SOFTWAREarchitekt.at [twitter] ManfredSteyer

    d Slides & Examples Munich, November 2018 or In-House Early-Bird Tickets available now! Discount Code: ngMunich (15%) http://www.softwarearchitekt.at/workshops