aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/guide/dev_guide.services.$location.ngdoc
diff options
context:
space:
mode:
authorAsh2013-08-13 08:08:09 +0100
committerPete Bacon Darwin2013-09-18 14:34:04 +0100
commitbda87f606f41acbccb5f55fc4095c7d44337a713 (patch)
treed27560989ed2718b5c994fdc97829603be09dc65 /docs/content/guide/dev_guide.services.$location.ngdoc
parent47dff0f3db1ddbdec5408dad8f9f007b3f027239 (diff)
downloadangular.js-bda87f606f41acbccb5f55fc4095c7d44337a713.tar.bz2
docs(guide/$location): describe workaround for collocated apps
When using Angular in the root of a domain with HTML5 URLs where there are links to external paths within the same directory, the `otherwise` route handler will catch these external files. This can be fixed by prefixing '.' onto the links to URLs that should be handled by angular routing. Original Issue: #3520 Example of Fix: http://fiddle.jshell.net/fgHf6/3/ Closes #3555
Diffstat (limited to 'docs/content/guide/dev_guide.services.$location.ngdoc')
-rw-r--r--docs/content/guide/dev_guide.services.$location.ngdoc8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/content/guide/dev_guide.services.$location.ngdoc b/docs/content/guide/dev_guide.services.$location.ngdoc
index fdfa2b0b..fac3ca6f 100644
--- a/docs/content/guide/dev_guide.services.$location.ngdoc
+++ b/docs/content/guide/dev_guide.services.$location.ngdoc
@@ -321,6 +321,14 @@ reload to the original link.
Example: `<a href="http://angularjs.org/">link</a>`
- Links starting with '/' that lead to a different base path when base is defined<br>
Example: `<a href="/not-my-base/link">link</a>`
+
+When running Angular in the root of a domain, along side perhaps a normal application in the same
+directory, the "otherwise" route handler will try to handle all the URLs, including ones that map
+to static files.
+
+To prevent this, you can set your base href for the app to `<base href=".">` and then prefix links
+to URLs that should be handled with `.`. Now, links to locations, which are not to be routed by Angular,
+are not prefixed with `.` and will not be intercepted by the `otherwise` rule in your `$routeProvider`.
### Server side