I recently started working with ng2. So I created a project using angular-cli, then realized that I needed third-party modules. For example, Google maps api, lodash, jquery ... etc. I know the basics of Typescript, but how to use these modules in an Angular2 application? In addition, I want to use only the library, for example, Google maps api, and not any existing ng2 module / component that someone else made ontop Google maps api for the sake of training.
Previously, only with JS I would include a js file and refer to the api documentation to find out which methods are referencing and building my application. Now with Angular2, what steps should I take to do the same?
From my research, it looks like I first installed the necessary script type files. so for google maps i did npm install --save @types/google-maps . Now, do I need to import this module into my angular application by including it in app.module.ts? In the import array? Or is it now available worldwide?
One source mentioned installing it with npm and in my angular-cli.json, including a link to this library in an array of scripts. So:
"scripts": ['./node_modules/googlemaps/googemaps.min.js'],
What method to use when installing google maps api? I would think Typescript might be the way to go, since the rest of the angular application will be written to Typescript.
Now in my app.component.ts, I want to create a simple map using the installed Typescript. How can I do it? Google Maps api is said to create a new instance of such a map.
var map = new google.maps.Map(document.getElementById('map'), { center: {lat: -34.397, lng: 150.644}, scrollwheel: false, zoom: 8 });
How do I do this with the Typescript version of Googlemaps I just installed?
Will the Googlemaps Typescript version have all the same methods as the original API? Is there a documentation site in the scripts of popular JS libraries that I can link to?