Aj A Aj A - 12 days ago 5
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);
element.append(content);
}
}
});


my url in is displayed as

http://localhost/'https://examples.form.io/simple'


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

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.

Comments