3

I am new to AngularJS and trying to learn the ropes.

I'm using the following line of code (untested mind you) to send an item of information to a server method that will then send an HTML email containing said item.

$http.post('/EmailItem', item);

My question is, do item's property values go through encodeURIComponent before being sent?

Bonus question: Is there a better way of doing the post? $resource seems on the face of it to be more than what I need...?

1 Answer 1

3

You don't need to encode the properties, $http does: https://github.com/angular/angular.js/blob/master/src/ng/http.js#L758

As to the way of doing it.. This looks fine. You can switch to $resource if have an object that needs a couple of REST things on the server, but $http works fine in simple situations.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.