Include angular element into expressionengine cms website - angular7

I exported an angular element into one javascript file so i could include it in a page in my expressionengine cms website but i get the error: SyntaxError: `` literal not terminated before end of script.
The weird part is that i included the script in my localhost:8080/mypage/index.html and works fine!
I would appreciate any help about this, thank you!

Solved! The issue was that i missed to add on the header:
<base href="/">
Or whatever path you want to place your code in.

Related

rails 4.2.6 upgrade-insecure-requests CSP meta how to put in the head?

I have a Rails 4.2.6 application running. In some of my pages, I use iframe to put Google Map Embedded api to show maps of some locations. My whole website is https secured using letsencrypt. However the pages that use google map api always get a "Not Secure" warning from Chrome or Firefox. When I remove the google map iframes, the warning disappears.
I have googled a lot and there is a workaround in here using meta tag. The workaround is an HTML format, but I still don't know how to put the meta tag to my rails application. The keyword seems to be "upgrade-insecure-requests".
Please help, thank you .
Solved!
just put this line
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
in your main html file.
In my case, it is not application.html.erb, it's another file. After I put that line in my home page file, everything is working just fine now.

angular pwa 8 ng serve refresh throws the error

I'm using pwa in my angular application, when ever I serve my application using ng serve refreshing the page cause manifest.webmanifest not found. Is there any workaround to prevent this. Thank you.
Please add the below code in your index.html and also check the manifest file in your project. You can changes the extension of your manifest file to .json. It worked for me
<link rel="manifest" href="manifest.json">
Also, please check the MIME type of your response(should be application/manifest+json or application/json) based on file extension

Where to add ES6-Promise Script Tag In ASP.net MVC?

I'm using the sample here to embed a Power BI report into a web application.
The application compiles properly, but I'm getting an error involving Promises. I've tracked down the solution here. It seems that I need to add the following somewhere in my application:
<script src="https://npmcdn.com/es6-promise#3.2.1"></script>
However, I have absolutely no idea where this script tag should go. Any suggestions? Thank you.
The es6-promise library is a polyfill for Promises, mostly used in IE.
If you need it, you just need to put it anywhere in your <head> tag, preferably before your <script src='.../powerbi.js>.
For more info on es6-promise: https://github.com/stefanpenner/es6-promise

My first DART polymer project: No execution / testing possible, nothing works?

I have created a polymer project. It generates a default app which reverses text entered into an input field. This works.
Then I tried to add a core-header-panel. I copied the code from the description page into the index.html file of the project:
<body unresolved fullbleed layout vertical>
<core-header-panel flex>
<core-toolbar>
<div>Hello World!</div>
</core-toolbar>
</core-header-panel>
<main-app>
</main-app>
<script type="application/dart">export 'package:polymer/init.dart';</script>
</body>
This gets me 3 warnings on the displayed web page. Two say:
Custom element found in document body without an "unresolved"
attribute on it or one of its parents.
I have inserted an unresolved attribute after the body tag. I do not understand why the error does not go away.
The third messages is:
custom element with name core-toolbar not found
I added a line
<link rel="import" href="packages/core_elements/core_toolbar.html">
but the error message did not go away.
Finally I outcommented the complete core-header-panel and nevertheless the page in Dartium still shows "Hello world" and all the error messages.
I'm lost here. The DART editor / Dartium "development system" seems to be useless. I can not even test the simplest things. What am I doing wrong? How do you work with this system???
BTW: I get exactly the same behaviour when I try to run this as Javascript in Firefox browser ...
You need to add an import for core-toolbar and core-header-panel.
You also need to add a dependency to the pubspec.yaml file.
dependencies:
core_elements: any
Otherwise I can't see anything wrong.
If this doesn't work, please try to run pub cache repair in your project directory (from command line).
If this still doesn't work please add the complete content of your pubspec.yaml, pubspec.lock and index.html to your question.
Meanwhile I found a solution by accident. The problem was that whatever I changed in the sources the DART editor always transfered the initial errornous file to the browser, or at least this is what it looks like.
The problem disappeared when I switched to another polymer project which I had used as an initial tutorial project, run that one and went back to the above project. Suddenly the browsers were able to display the changed files.
Looks for me like an ugly bug in the DART editor.

Both Flash and Alternate Displaying In Firefox, Nothing but Errors in IE (sIFR)

I've just installed and setup sIFR on my Magento store. An example page can be seen here:
http://www.mint-creative.co.uk/shop
And you can see it loads the heading brilliantly, but still displays the alternate text-only headline. I've quadruple checked the .css files and everything's loading ok I think. Also, in IE it doesn't display at all and every .css and .js file has an error according to the error log in IE8.
Any help on this would be great as it's an urgent project!
Cheers.
This is a known issue with IE8. The best thing to do is put this in your header
< meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
(I had to add a space after < to get it to show up for some reason so make sure you delete that space)
It'll fix your problem.
I'd also try Cufon or Font-face over sIFR.
There's a parse error in the CSS files. Try validating them and see what comes up.

Resources