A-Aryan
A-Aryan

Reputation: 1

Angular JS application page refresh issue

I am working on an angular application and i have used "$locationProvider.html5Mode(true)" in my route config to avoid /#/ in URL. I have also added base href="/" in index.html and everything is working fine on refresh of pages.

But when i am trying to refresh the page having URL

"http://localhost:3000/home/:JavaScipt%20SC2.0"

Then i am getting Cannot GET /home/:JavaScipt%20SC2.0 error. I think error is due to name "JavaScript SC2.0" containing .(dot) symbol. Any clue to fix this issue?

Upvotes: 0

Views: 145

Answers (2)

Kunvar Singh
Kunvar Singh

Reputation: 1885

you can try on send it on another state: or you can use the $window dependency into your controller, and use as javascript.

Upvotes: 0

Foo Bar
Foo Bar

Reputation: 165

But when i am trying to refresh the page having URL

"http://localhost:3000/home/:JavaScipt%20SC2.0"

Your route has at least two problems:

  • First, document name misspelled, shouldn´t it be JavaScript? (with R)
  • Second, you can´t use home/ : Jav... (/:Javascipt??)

try again with http://localhost:3000/home/JavaScript SC2.0 into a variable and pass it.

More info in this link

PS: If (whoever) knows so much that can mark my answer as not valid, please ALSO post a valid answer, not just a negative ;)

Upvotes: 1

Related Questions