tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.4k stars 763 forks source link

Angular 8 Example - The Angular 5 Example Has Error Using Angular-8 #115

Closed bryanray67 closed 5 years ago

bryanray67 commented 5 years ago

I'm using Angular 8. I've downloaded the charting_library folder and datafeeds folder into the sample Angular 5 app in the "assets" folder as instructed, but I get an error on compile (ng serve).

ERROR in src/app/tv-chart-container/tv-chart-container.component.ts(114,18): error TS2339: Property 'attr' does not exist on type 'HTMLElement'.

If I comment out the .attr line, it errors on the next.

This occurs in the following code in tv-chart-container.components.ts

       tvWidget.onChartReady(() => {
            const button = tvWidget.createButton()
                .attr('title', 'Click to show a notification popup')
                .addClass('apply-common-tooltip')
                .on('click', () => tvWidget.showNoticeDialog({
                    title: 'Notification',
                    body: 'TradingView Charting Library API works correctly',
                    callback: () => {
                        console.log('Noticed!');
                    },
                }));

            button[0].innerHTML = 'Check API';
        });

Do you have a working example using Angular 8? Many thanks!

timocov commented 5 years ago

Unfortunately the examples isn't updated to use them with the latest version of the charting library. We'll fix them soon. See #113.