Fidan Hakaj Fidan Hakaj - 27 days ago 10
AngularJS Question

Reuse an angular 1 module in NativeScript angular 2 app

I would like to reuse an angular 1 module in a NativeScript - angular 2 app.

I have read about the upgrade module and its

UpgradeAdapter
service in angular 2 docs.


[...] service that can bootstrap and manage hybrid applications that support both Angular 2 and Angular 1 code.


In order to use the
UpgradeAdapter
service, its
bootstrap
function should be called.

Knowing that NativeScript also requires to call a bootstrap function
nativeScriptBootstrap
, I am wondering if it exposes a way to use the
UpgradeAdapter
bootstrap instead of the standard angular 2 one.

Edit: I created an issue in their github repo.

Answer

No support for Angular 1 module is planned as stated in this comment from nativescript-angular contributor.

We never intended to support Angular 1 components, and I doubt we'll allocate resources for it in the foreseeable future.

That said, there is no problem for support for the UpgradeAdapter come from a separate library developed by the community. We'll consider PR's that make it easy for such a library to do its job.