Following the official 5 min QuickStart I have a simple Angular 2 app working.
I set up Angular 1 and have now them both working independently, see this plunker.
Following the official upgrade guide they say:
To then switch the application into hybrid mode, we must first install Angular 2 to the project. Follow the instructions in the QuickStart for some pointers on this. When we have Angular 2 installed, we can import and instantiate the
UpgradeAdapter
, and then call itsbootstrap
method. It is designed to take the exact same arguments as angular.bootstrap so that it is easy to make the switch:import {UpgradeAdapter} from 'angular2/upgrade'; /* . . . */ const upgradeAdapter = new UpgradeAdapter(); upgradeAdapter.bootstrap(document.body, ['heroApp'], {strictDi: true});
My question is where to place it?
It sounds like a 'do my job' question but it's not so. I guess in main.ts
, but I tried a lot of things without success. The doc is not really clear about this and some tutorials of 1 month old are already outdated.
--- update:
In my case I forgot to load upgrade.js that I thought already included