title: Is it possible to change the base url in angular?
body: <p>I am writing a web app with a java servlet back end and I am checking out angular for the front end. Since the address to a specific resource within a servlet depends on what servlet context it is placed in, I am wondering if it is possible to change the base url for all angular functions.</p>
  
  <p>Example:
  If I create a link in my webapp <code>&lt;a href='/newaccount'&gt;Create new account&lt;/a&gt;</code> and I configure the route provider accordingly <code>$routeProvider.when('/newaccount', ...</code> I want this to work no matter what servlet context my servlet is placed in. So if I place my servlet in a context called "mycontext" the actual url to the resource will be <code>[hostname]/mycontext/newaccount</code>. </p>
  
  <p>Can I somehow setup angular and pass in the context name so that it is prepended to all locations and configured routes? This way the servlet could be placed in different contexts and still work.</p>