title: RFC valid URL for SPA (angular) apps
body: <p>I'm writing an angular 1.5 app that is relying on a REST service. In some flows the service is asking the client for a redirect URL, attaches params to it and sends the URL to the user.</p>
  <p>For most clients the service is using query params, hence when given:</p>
  <blockquote>
  <p><a href="http://www.myapp.com/myState" rel="nofollow noreferrer">www.myapp.com/myState</a></p>
  </blockquote>
  <p>it returns</p>
  <blockquote>
  <p><a href="http://www.myapp.com/myState?myParam=value" rel="nofollow noreferrer">www.myapp.com/myState?myParam=value</a></p>
  </blockquote>
  <p>But for the angular app, when given:</p>
  <blockquote>
  <p><a href="http://www.myapp.com/#/myState" rel="nofollow noreferrer">www.myapp.com/#/myState</a></p>
  </blockquote>
  <p>it returns</p>
  <blockquote>
  <p><a href="http://www.myapp.com/?myParam=value#/myState" rel="nofollow noreferrer">www.myapp.com/?myParam=value#/myState</a></p>
  </blockquote>
  <p>and that violates the app's routing.</p>
  <p>It happens since according to RFC <a href="https://www.rfc-editor.org/rfc/rfc3986#section-4.1" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc3986#section-4.1</a> everything that follows the # sign is considered the URL fragment and should be at the end of the URL.</p>
  <p>I deduct that angular's query params are not exactly RFC legal, and are in fact some kind of &quot;fragment params&quot;.</p>
  <p>So what is the correct, generic way to build URL's that will be used by various client types: mobile, web, SPA etc. and still be RFC valid?</p>