Embed Tradingview into Angular 5

前端 未结 6 1313
北荒
北荒 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:33

    Sup Guys! Other Solution if these charts are necessary for you(like in my case) you can create a simple backend side for your app using, for example, Flask:

    Create index.html (app/templates/index.html) with widget code in it, in init.py (app/init.py):

    from flask import Flask, request, render_template
    from flask_restful import Resource, Api
    from flask_cors import CORS, cross_origin
    
    app = Flask(__name__)
    app.config['DEBUG'] = True
    CORS(app)
    
    @app.route('/tradingView')
    def getChart():
        return render_template('index.html')
    
    if __name__ == '__main__':
        app.run(port=6200)
    

    then just start running server

    In your component add:

    
    

    This solution requires python and flask knowledge but its as simple as it can be, good luck!

提交回复
热议问题