Reputation: 2234
How to include this external java script library inside Angular2 page view .
I want to include this
<!-- google maps javascript -->
<script src="//maps.googleapis.com/maps/api/js?key=#######&sensor=true"></script>
so when this page is in view this library is loaded and start working .
Upvotes: 3
Views: 2429
Reputation: 2330
You can't.
The Angular processor remove all script tag in the template files for a security reason.
Alternatives:
index.html
.ts
file using import 'path/to/file'
.Upvotes: 2