I would like to take a string
var a = \"http://example.com/aa/bb/\"
and process it into an object such that
a.hostname == \
The AngularJS way - fiddle here: http://jsfiddle.net/PT5BG/4/
Parse URL using AngularJS
Parse URL using AngularJS
url:
- href = {{parser.href}}
- protocol = {{parser.protocol}}
- host = {{parser.host}}
- hostname = {{parser.hostname}}
- port = {{parser.port}}
- pathname = {{parser.pathname}}
- hash = {{parser.hash}}
- search = {{parser.search}}