File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -413,12 +413,20 @@ var locationPrototype = {
413
413
* This method is getter only.
414
414
*
415
415
* Return host of current url.
416
+ *
417
+ * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.
416
418
*
417
419
*
418
420
* ```js
419
421
* // given url http://example.com/#/some/path?foo=bar&baz=xoxo
420
422
* var host = $location.host();
421
423
* // => "example.com"
424
+ *
425
+ * // given url http://user:password@example .com:8080/#/some/path?foo=bar&baz=xoxo
426
+ * host = $location.host();
427
+ * // => "example.com"
428
+ * host = location.host;
429
+ * // => "example.com:8080"
422
430
* ```
423
431
*
424
432
* @return {string } host of current url.
You can’t perform that action at this time.
0 commit comments