everyone. Sometimes I need some way to get some part of external site url in my angular code. But there's obviously no way to do it with native angular services, and I don't wanna use some Jquery library for parsing url. I need some service for url parsing which. Where can I find such service? Thx!
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Correctly parse PDF paragraphs with Python
- Keeping track of variable instances
I guess you could use the $sce service:
As mentioned in other post, provided that this is not subject to CORS.
By Parsing, I'm assuming you mean fetching of content/data from a url.
Proving the url allows any domain ( 'Access-Control-Allow-Origin', '*' ) or your domain, Angular does have ajax functions built in, simular to jquery et all.
http://docs.angularjs.org/api/ng.$http
Copied direct from the anguar doc
You can do it in Vanilla JavaScript.
Source: https://gist.github.com/jlong/2428561