javascript - How to PUT only some fields with Restangular? -


let's have resource several fields, , of them read-only. or maybe belong in different use cases handle differently on server.

for instance, bing resource looks this:

{id: 1,  foo: "a",   bar: "b",   createdat: "2013-05-05"} 

i restangular put fields, executing requests like:

put /bing/1 {foo: "a"} put /bing/1 {bar: "b"} put /bing/1 {foo: "a", bar: "b"} 

what not want is:

put /bing/1 {id: 1, foo: "a", bar: "b", createdat: "2013-05-05"} 

how can achieve it?

i'm creator of restangular.

@nicholas absolutely right :). that's patch , not put. , restangular support :).

elem.patch({foo: 2}) way go if elem restangularized object.

hope helps!!


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -