Skip to main content
fixed urls
Source Link
Galdo
  • 945
  • 1
  • 6
  • 12

You should use $location.search() for this. It will allow you to add parameters to the URL from javascript.

For example, if you add this in the method called from ng-click :

$location.search('search','helloworld');

The url would change to abc.com?search=helloworld

You can also set objects in the second parameter to have comma separated values.

If you don't want your page to reload when you change the url, you will also have to disable the reloadOnSearch in your router.

More info here : http://docs.angularjs.org/api/ng.$location And here : http://docs.angularjs.org/guide/dev_guide.services.$location

You should use $location.search() for this. It will allow you to add parameters to the URL from javascript.

For example, if you add this in the method called from ng-click :

$location.search('search','helloworld');

The url would change to abc.com?search=helloworld

You can also set objects in the second parameter to have comma separated values.

If you don't want your page to reload when you change the url, you will also have to disable the reloadOnSearch in your router.

More info here : http://docs.angularjs.org/api/ng.$location And here : http://docs.angularjs.org/guide/dev_guide.services.$location

You should use $location.search() for this. It will allow you to add parameters to the URL from javascript.

For example, if you add this in the method called from ng-click :

$location.search('search','helloworld');

The url would change to abc.com?search=helloworld

You can also set objects in the second parameter to have comma separated values.

If you don't want your page to reload when you change the url, you will also have to disable the reloadOnSearch in your router.

More info here : http://docs.angularjs.org/api/ng.$location And here : http://docs.angularjs.org/guide/dev_guide.services.$location

Source Link
Galdo
  • 945
  • 1
  • 6
  • 12

You should use $location.search() for this. It will allow you to add parameters to the URL from javascript.

For example, if you add this in the method called from ng-click :

$location.search('search','helloworld');

The url would change to abc.com?search=helloworld

You can also set objects in the second parameter to have comma separated values.

If you don't want your page to reload when you change the url, you will also have to disable the reloadOnSearch in your router.

More info here : http://docs.angularjs.org/api/ng.$location And here : http://docs.angularjs.org/guide/dev_guide.services.$location