In AngularJS, a GET request can be done by using:
$http({method:'GET', url:'', params:{:}}).success(function(data){ ...
Usually, in place of param value I use $form.name where name is a ng-model bounded to a text box.
My question is, that name may contain character like '&'. How to encode such characters when sending data via angular ?
Like given in the above comment, encodeURIComponent will work. But if you want to support old browsers also, you can easily do an encoding by yourselves. You can get all the URL Encoding Reference from W3schools.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.