How to Install 3rd Party Libraries in Ionic 2

Ionic 2 allows you to do a wide range of things right out of the box, but there is likely going to come a time where you need to install some 3rd party library to add additional functionality into your applications.

You may want to add Google Maps, add a charting library, add support for PouchDB, or any of the thousands of libraries that are available out in the wild.

There are some specific steps you will need to take in order to get most of these libraries working in Ionic 2, in this video tutorial, I walk through a couple of common examples.

Here’s the video:

  • You can install most libraries using npm install LIBRARY_NAME
  • You can install types for most libraries using npm install @types/LIBRARY_NAME
  • Once a library has been installed, you can usually import it into components that require it like this: import Thing from 'libraryname'
  • It is also possible to add a library to your application just be adding a <script> tag to your index.html file

IMPORTANT: Although most libraries you encounter will be able to be installed like this, or in a similar way to this, it will depend on the library itself.

Advanced Animations & Interactions with Ionic

NEW Create next level Ionic applications by harnessing the power of the Ionic Animations API and Gestures.

Utilise these powerful APIs to design and build your own custom animations and interactions. No external libraries required, everything is built with just Ionic. Learn more.

Follow me on Twitter or subscribe to me on YouTube for more web development content.

Check out my latest videos: