This repository was archived by the owner on Aug 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ export interface IService {
1515 cachememory : ICacheMemory ;
1616 cachestore : ICacheStore ;
1717 parseFromServer ( attributes : IAttributes ) : void ;
18- parseToServer ( attributes : IAttributes ) : void ;
18+ parseToServer ? ( attributes : IAttributes ) : void ;
1919}
Original file line number Diff line number Diff line change @@ -84,8 +84,14 @@ export class Resource extends ParentResourceService implements IResource {
8484 }
8585 } ) ;
8686
87- let attributes = angular . copy ( this . attributes ) ;
88- this . getService ( ) . parseToServer ( attributes ) ;
87+ // just for performance dont copy if not necessary
88+ let attributes ;
89+ if ( this . getService ( ) . parseToServer ) {
90+ attributes = angular . copy ( this . attributes ) ;
91+ this . getService ( ) . parseToServer ( attributes ) ;
92+ } else {
93+ attributes = this . attributes ;
94+ }
8995
9096 let ret : IDataObject = {
9197 data : {
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export class Service extends ParentResourceService implements IService {
151151 let paramsurl = new UrlParamsBuilder ( ) ;
152152 path . applyParams ( this , params ) ;
153153 if ( params . remotefilter && Object . keys ( params . remotefilter ) . length > 0 ) {
154- this . getService ( ) . parseToServer ( params . remotefilter ) ;
154+ this . getService ( ) . parseToServer ? this . getService ( ) . parseToServer ( params . remotefilter ) : null ;
155155 path . addParam ( paramsurl . toparams ( { filter : params . remotefilter } ) ) ;
156156 }
157157 if ( params . page ) {
@@ -300,8 +300,4 @@ export class Service extends ParentResourceService implements IService {
300300 public parseFromServer ( attributes : IAttributes ) : void {
301301
302302 }
303-
304- public parseToServer ( attributes : IAttributes ) : void {
305-
306- }
307303}
You can’t perform that action at this time.
0 commit comments