Embed Tradingview into Angular 5

前端 未结 6 1352
北荒
北荒 2021-01-12 01:04

I just copy the function in the embed script found here (https://www.tradingview.com/widget/advanced-chart/) into a component in my Angular 5 app, and include the source scr

6条回答
  •  时光取名叫无心
    2021-01-12 01:24

    1. I added widget loading scripts to index.html, after
    2. in component's template-file (html) I leaved only html tags
    3. in component's ts-file:

      declare const TradingView: any;

      and in ngAfterViewInit() I putted new TradingView.widget(...) inside setTimeout

    And that's it! It works.

提交回复
热议问题