convert angular 2 application to integrate able sdk

Viewed 179

i have a angular 2 application. I was wondering if i could convert this application to an integrate-able sdk which other applications can use by adding script tags in their headers. If this is not possible can anyone provide any tutorial link which shows how can i build a simple sdk which can be integrated in other applications. thank you.

1 Answers

Of course you can! In javascript terms, it's not called "SDK" but "module". The most popular module manager is called NPM. So you can follow this tutorial to package your "application" as NPM module, then it will be easy for other js developper to integrate it inside their own projects (using the tags, services, directives you defined.

Here is a good post about it

Cheers!

EDIT : if you want to use your angular components/modules outside in non-angular application, you can follow this one. In the example it is used with React app but it will work with any html5-compliant browsers.

If you want to target also non-compatible browsers, you should add a polyfill

Related