angular-restmod icon indicating copy to clipboard operation
angular-restmod copied to clipboard

Maintain private nested properties on resources

Open garethhudson07 opened this issue 10 years ago • 1 comments

Hi Guys, I am hoping that someone can help me with this

Imagine you have the following resource

{
    $privatePropOne : 'value',
    publicPropOne: {
       $privatePropTwo: 'value',
       publicPropTwo: 'value'
    }
}

When this is sent to the server $privatePropOne remains in tact after the response. However $privatePropTwo is removed.

Currently I have dealt with this by extending the $save function, extracting the private nested properties and adding them back in once the resource has been returned.

However I wondered if anyone knew of a more elegant solution.

Any ideas would be greatly appreciated.

Thanks in advance

Gareth :)

garethhudson07 avatar Apr 26 '15 12:04 garethhudson07

You could use a nested resource.

jczerwinski avatar Jul 07 '15 22:07 jczerwinski