I think I'm super late for this answer, but I hope it works for someone with the same problem:
The problem lies in the following: With angular you can execute tags in the index file, however using those tags in components is much more complex since there is angular code on top of it. So what we are going to do is avoid launching the script without the tag.
1.In the index.html file (in the body) paste the embed_loader:
<script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/2578_RC02/embed_loader.js"></script>
2.Now we go to the component where you want to show the graph. Create a div that will contain the graph:
<div id="googleTrendsGraph"></div>
3.In the ngOnInit we save the HTML component that we have created:
const wrapper = document.getElementById('googleTrendsGraph');
4.Instead of using renderExploreWidget we are going to use its brother renderExploreWidgetTo which does the same but we indicate where we put the graph, and in this way we avoid using the script tag
ngOnInit(): void {
const wrapper = document.getElementById('googleTrendsGraph');
trends.embed.renderExploreWidgetTo(wrapper, 'TIMESERIES', {
'comparisonItem': [{
'keyword': 'cloud tourism',
'geo': 'KR',
'time': 'today 5-y'
}, {'keyword': 'computing innovations', 'geo': 'KR', 'time': 'today 5-y'}, {
'keyword': 'computing containers',
'geo': 'KR',
'time': 'today 5-y'
}, {'keyword': 'cloud services', 'geo': 'KR', 'time': 'today 5-y'}, {'keyword': 'computing ksu', 'geo': 'KR', 'time': 'today 5-y'}],
'category': 0,
'property': ''
}, {
'exploreQuery': 'date=today%205-y&geo=KR&q=cloud%20tourism,computing%20innovations,computing%20containers,cloud%20services,computing%20ksu',
'guestPath': 'https://trends.google.com:443/trends/embed/'
}); }
