0

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

2
  • Well, can you tell me what do you need instead of what you don't want ? It would be easier for me to help you. Commented Nov 22, 2016 at 14:10
  • Final template should be like this <formio src="'examples.form.io/simple'"></formio> Commented Nov 22, 2016 at 14:12

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

but that single quotes is required for my form.io src
You can see the url: localhost//'https://examples.form.io/simple' . What documentation are you referencing that makes you believe the sindle quotes are required? You are double quoting it in your template.
I am not arguing, but in my output I have localhost/'https://examples.form.io/simple' , there I have localhost is the extra thing
See above, I just took your code and tested it and it worked. Did you modify your example before posting?
Now I removed the cache and checked, its working.. Thank you very much

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.