Found the solution for this issue, Here is the solution
Add the below code in to
1. In app.component.js import Tableau js file
Ex: import '../assets/libs/tableau-2.1.2.min.js';
2. In Dashboard.component.js create a tableau variable
Ex: declare var tableau: any;
the above solution fixed my issue.
Do you have to provide the api path in both .angular-cli.json & app.component.ts or only in app.compoent.ts?
Imports in app.component.ts seems to look for the api under "src\app" folder irrespective of where the library is stored and what path you provide in the [scripts].
I can get this working only by providing in index.html & no other place and nor do I have to import ONLY if I provide the path to Tableau server.. But if I try to reference to local path, I get error. I want to refer to the local copy, Since my intention is to use dev version tableau extension library which is not in server.
I may be too late here but I am trying this api for angular 6.
Including the tableau.js in html works one time but breaks again other time. I tried it including in angular.json still the similar problem. At one point it fails compiling with error "Couldn't find tableau".
It seems to be working now by including it in angular.json as well as app.component.js
"import tableau from tableau-api" (after - ng i tableau-api) did not work for me.