0

I am trying to pass a string as a url parameter, specifically as param1 in my URL. Here is the router code in my AngularJS code

.when('/test/:param1?/:param2?', {
    templateUrl: 'components/test/testPage.html',
    controller: 'TestPageController'
 })

I am looking to pass the following string to the testPage.html page

KEY WEST / Florida(FL)

I have tried several kinds of encodings as suggested in my previous question here

Encoding all the special characters in Javascript

param1 = encodeURIComponent("KEY WEST / Florida(FL)")
"KEY%20WEST%20%2F%20Florida(FL)"

param1 = escape("KEY WEST / Florida(FL)")
"KEY%20WEST%20/%20Florida%28FL%29"

But no matter what I do, I get a HTTP 404 Page not Found. I understand that the second approach may not work because the escaped string also has a / in it so maybe I should use the first approach but even that doesn't work. Is there a limit on the number of characters on the URL parameter that I am not aware of?

p0tta
  • 1,461
  • 6
  • 28
  • 49

0 Answers0