1

I am new to angularJs. I have a issue when I am working on an app with angularjs and ruby on rails at the backend. Whenever i have a '?' in the url it gets converted into %3f in the url and hence giving a wrong output.

The question I have is that can i somehow bypass the question mark in the url so that I can get the proper Url.

For eg:-

The following url $location.path("www.test.com/program/who-is-this?") gets converted into below url

"www.test.com/program/who-is-this%3f"

I want a question mark instead of %3f in the url. I have gone through some of the questions on the forum but it is not helping me much. Please help

1 Answer 1

1

$locations's path method only operates with angular's part of url (the one, that usually after '#' symbol). You may want to use $location.url method to be able to replace part, that contains '?' symbol.

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

3 Comments

I tried $location.url("www.test.com/program/who-is-this?").It removed Question mark from url..Actually I want to display the question mark in the url.
@PeeVee I suppose, modifying url in this way (adding '?' symbol) will lead to page reload. That's why AngularJs (Single Page Application framework) may not provide such API.
@andrey-shustariov..Is there any other way you can suggest by which we can implement the above.

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.