angular - Use AngularJS (Angular1) module from Angular2 project -


just started demo angular2 project (no previous experience angular1/angularjs. have followed , extended online quickstart , tutorials, , fine. i'm @ point use components library designed angularjs, , having no end of problems!

most of information available angularjs/angular2 compatibility assumes have angularjs project you're adding angular2 components - not other way around - i'm hoping may not possible. i've tried far involves simple stripped-back project based on angular2 quickstart, single angular2 component loads index.html. i'd integrate components existing library (angularjs-based) this.

  • i've tried using upgradeadapter.upgradeng1component create components library , add them directly angular2 component

  • i've tried installing angularjs through npm, importing in script tag index.html , using combination of upgradeadapter.downgradeng2component , upgradeadapter.bootstrap load angular2 downgraded module

neither of these seem work - component fails show, , browser console tells me i've got uncaught syntaxerror: unexpected token < evaluating http://localhost:3000/angular2/upgrade error loading http://localhost:3000/app/main.js

my best guess @ moment unsupported scenario, , need have 'proper' angularjs app in order use upgradeadapter functionality angular2. can confirm this? or there stupid i'm missing here?

here working plunkr describing how mix angular1 , angular2 elements:

an important point bootstrap main component on upgradeadapter. way elements available in providers (services / factories) , in directives (components / directives):

upgrade.bootstrap(document.body, ['heroapp']); 

these 2 answers you:


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -