Jump to content
  • 0

How to embed / call external javascript in Angular 8 Application utilizing Caspio Datapage


williamjord

Question

 

I am looking to build an Angular 8 application and call Caspio datapages from inside.

The standard approach to using a Caspio Datapage is to embed a script tag as follows:

<script type="text/javascript" src="https://c1acu417.caspio.com/dp/A57E7000f6812a2641704a929225/emb"></script>

However, it does not seem to be working.

So, for example, I am doing the following:

Setup a StackBlitz ( https://stackblitz.com/edit/angular-m6cshx?file=src%2Fapp%2Fapp.component.html )

Nothing shows up.

Here, it is working in static html:

https://codesandbox.io/s/cocky-dawn-8l7pvnyfo

Does anyone have any experience or ideas as how to achieve this in Angular?

Why cannot I simply embed that script?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I am not a strong angular expert, but you cannot add script elements in the html page of your (angular) components. If you google around the web you can found a lot of examples. A page where the concept is well eplained is this https://medium.com/@Codeible/adding-loading-and-using-javascript-in-angular-3281ea4b056b

The basic concept is that you have to make available the script and then create a script element object.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...