Aj A Aj A - 1 year ago 75
Javascript Question

Remove the http://localhost prefix from the url

In my angular code

app.directive("myDom", function ($compile) {
var url = "\'https://examples.form.io/simple\'";
return {
link: function (scope, element) {
var template = '<formio src="' +url+ '"></formio><button>ClickMe</button>';
var linkFn = $compile(template);
var content = linkFn(scope);

my url in is displayed as


How do I remove the prefix http://localhost

Seen the answers for the below questions but it didn't helped

Why is my JS putting a prefix to my links (localhost:3000/mylink)?

Removing http:// prefix from ASP loaded URL

Nix Nix
Answer Source

Something else has to be going on because I just took your code and put it in a fiddle and its working fine: Fiddle. Something else has to be going on.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download