The accepted answer is only partially correct.
In general, url routing will work on Plunker exactly as it would work if your code were hosted in a sub directory (ie: not the root). This is important if you are using $locationProvider.html5Mode(true)
as it may lead to unexpected behaviour if you want to use absolute urls (eg: /partials/template.html
).
If you use one of the built-in Angular.js templates, you will notice that I have added a bit of a hack to get around the fact that previews are not hosted on subdomains:
<script>document.write('<base href="' + document.location + '" />');</script>
This takes advantage of how Angular.js' $locationProvider
treats <base href="">
tags by injecting a dynamic base tag before Angular.js bootstraps. See the relative links section on: https://docs.angularjs.org/guide/$location