I have to use parameter from url on the page.
For example, URL is smth like: url.com/index.html?username.
I need to take this "username" show it on the page, and use it several times to get the right link.
<img src='http://url.com/project/{{---username here---}}/{{id}}.png' alt='' />
I've tried to do it with $location.search. But it doesn't work. It shows "cannot read property search of undefined" :((
Can you please tell me what I'm doing wrong and how should I do it in the right way?
Thanks a lot.
ngRouteorui-router?$locationservice in your controller? From the error it's obvious that$locationis not defined.