0
Under review

Adding script tag to Angular

Vishal 1 year ago updated by Christian Fritz 1 year ago 2

Hello,


I am using the Angular 8 framework for my website and I am unable to work with the BibBase script tag because most modern frameworks including Angular doesn't run a script tag on the HTML page because of the security risks. Is there any workaround this problem. I am not using any backend.


Thanks,

Vishal

Under review

I think this is really an Angular question. Angular must provide some other mechanism for fetching data from another server. Because yes, this should definitely be possible. Besides, the Angular realm will end somewhere, meaning that in the end it will be HTML + CSS + JS being interpreted in the browser, and at that point the script tag will definitely work. So even if Angular doesn't allow you to fetch HTML from somewhere else, it should be possible to have some static HTML survive or by-pass the Angular treatment.

Looking at their API, I would think that their HTTPClient.jsonp method is what you are looking for: https://angular.io/api/common/http/HttpClient#jsonp

With that you should be able to somehow fetch the JSONP version of your BibBase page directly: https://bibbase.org/show?bib=https%3A%2F%2Fbibbase.org%2Fbibs%2Fex.bib&jsonp=1