Code Monkey home page Code Monkey logo

ngupgrade-aot-sample's Introduction

Sample for ngUpgrade with AOT

Overview

Overview

Structure

  • app/app.module.ts: Angular 1 module
  • app/app2.module.ts: Angular 2 module
  • app/app.ts: Bootstraps the hybrid application

Problems

The FlightSearchComponent is not able to display the upgraded FlightCardComponent (after searching for flights from Graz to Hamburg).

The FlightCardComponent is registered within the file app.module.ts which creates an angular1 module. The file app2.module.ts defines an ng2-based facade for it.

The same holds true for a component ng1 that works like the ng1-component in the test cases.

The good message

Every other scenario displayed above already works in this sample.

Build and Start

  • Build: ``npm run build`
    • Runs ngc and webpack
  • Start: npm start
    • Does not created a build, so run npm run build before
    • Starts live-server

Other questions

  1. Why don't we have a convenience function for upgrading, like we had when using UpgradeAdapter? For instance, currently we have to do this, to perform an upgrade:

    @Directive({selector: 'ng1'})
    export class Ng1 extends UpgradeComponent {
    
        constructor(elementRef: ElementRef, injector: Injector) {
            super('ng1', elementRef, injector);
        }
    }
    

    Is this because a convenience function would be too dynamic for the compiler?

  2. Why do all the samples and test cases use platformBrowserDynamic, although we are using AOT?

    bootstrap(
        platformBrowserDynamic(),
        AppModuleNgFactory,
        document.body,
        'flight-app')
    

ngupgrade-aot-sample's People

Contributors

manfredsteyer avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.