{"_id":"@beradrian/ngx-resource-core","_rev":"3-66dc4b0396a5639c5584a04446f0772e","name":"@beradrian/ngx-resource-core","dist-tags":{"latest":"5.4.2"},"versions":{"5.4.0":{"name":"@beradrian/ngx-resource-core","version":"5.4.0","description":"Core of resource library","scripts":{"clean":"rimraf dist","lint":"tslint --config tslint.json --project tsconfig.json --type-check --format stylish","tsc":"tsc","webpack":"webpack","build":"npm run clean && npm run lint && npm run tsc && npm run webpack","build.full":"npm run build && cpx package.json dist/ && cpx README.md dist/","xprepublish":"npm run build.full","publish":"npm publish dist --access public"},"keywords":["ngx-resource","ngx-resource-core","ngx-resource-rest","ng2-resource","ng2-resource-rest","Angular2","Resource"],"repository":{"type":"git","url":"git+https://github.com/beradrian/ngx-resource-core.git"},"main":"bundles/core.umd.js","module":"index.js","typings":"index.d.ts","author":{"name":"Roman Rosluk","email":"roma@redbox.by"},"license":"MIT","bugs":{"url":"https://github.com/troyanskiy/ngx-resource-core/issues"},"devDependencies":{"@types/node":"^8.0.34","awesome-typescript-loader":"^3.2.3","clean-webpack-plugin":"^0.1.17","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.5.3","webpack":"^3.12.0","cpx":"latest"},"homepage":"https://github.com/beradrian/ngx-resource-core#readme","_id":"@beradrian/ngx-resource-core@5.4.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.1","_npmUser":{"name":"beradrian","email":"beradrian@yahoo.com"},"dist":{"integrity":"sha512-e3kBXsU5qLyCMleYZ5KL+BJBPAFXvbIQKooT3QNgD/17EVrLrj2gvXELQQpW4bYfgv4u4NSHBmHi3HMTaoZMzw==","shasum":"6f82a6565ac922ec3e2f421f97ffaf6648727ff4","tarball":"https://registry.npmjs.org/@beradrian/ngx-resource-core/-/ngx-resource-core-5.4.0.tgz","fileCount":25,"unpackedSize":197173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4ukdCRA9TVsSAnZWagAAeUwP/3GpcsRmKaK+psbA4F+8\nJ+0/NIjxb8roKirYxgMuzsGHhsBKl9puI0owouTIxGg4xrLfbZJTcarhGtBw\naUiOpjgHcmYLmVVJXH3EN8rpdvV/oxfhubSLLDdS2tj5i89WtQGbaOwEGzPi\n3eQHQmqYufKLNcoxCrds1nUyjoFJOfObbclOZNy9W+2zIIOOph0tBpBff0A9\nAvQvw8AQQnEM6xodMG6m762pxGs5OxOtx1a7eC5XUOt/Snyecrb7yLwbwyS3\nQ2ID6EiylhS4nnJowJmnFfbmLqBtpE635PU6A+On+ze06q3GPVXRfe7LHSIF\nx9qySEQ8NmfBwXGWqG58oP195mQNwyaI/nyheKsSPSAV44gn0q8PQgZvaNph\nfZhaEFYg4HBXkUK5T92Ahega2jFHq1Lvg9W+KRBy8axy3vOfsKxqy1U2BEr4\nNBDfEMQs0ZVj8wiDRb8OppYqs3ZXJhzexVLzZS0ygfA90oAId9FIeq1FnxXk\ndnopVDfQHvE6ZdoX1AHy9snddr6rkFYMetB5WQk6YLP93dJ36PnsEhyxjacz\nwkh0KxDbOXh0laGTgjOakG3yyArKvOBPB+uSHlWLkBMrSXf6m14Nf2fzArfX\nCdj0fFyM9rU7+CSvneTqet511RGBeAVf7yej+SUP9NDYAHnTTtyFICjs4RmA\n0UyI\r\n=kXss\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+RMhu68SzVqTgtnuIZgf4Xwvyywejt/z9NpX9O+T3/AiAu1LDYSiOyFLycDHRpwmHS5HTntptjIc5pkowSVlYBWg=="}]},"maintainers":[{"name":"beradrian","email":"beradrian@yahoo.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-resource-core_5.4.0_1541597468999_0.371074540086632"},"_hasShrinkwrap":false},"5.4.1":{"name":"@beradrian/ngx-resource-core","version":"5.4.1","description":"Core of resource library","scripts":{"clean":"rimraf dist","lint":"tslint --config tslint.json --project tsconfig.json --type-check --format stylish","tsc":"tsc","webpack":"webpack","build":"npm run clean && npm run lint && npm run tsc && npm run webpack","build.full":"npm run build && cpx package.json dist/ && cpx README.md dist/","publish":"npm publish dist --access public"},"keywords":["ngx-resource","ngx-resource-core","ngx-resource-rest","ng2-resource","ng2-resource-rest","Angular2","Resource"],"repository":{"type":"git","url":"git+https://github.com/beradrian/ngx-resource-core.git"},"main":"bundles/core.umd.js","module":"index.js","typings":"index.d.ts","author":{"name":"Roman Rosluk","email":"roma@redbox.by"},"license":"MIT","bugs":{"url":"https://github.com/troyanskiy/ngx-resource-core/issues"},"devDependencies":{"@types/node":"^8.0.34","awesome-typescript-loader":"^3.2.3","clean-webpack-plugin":"^0.1.17","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.5.3","webpack":"^3.12.0","cpx":"latest"},"homepage":"https://github.com/beradrian/ngx-resource-core#readme","_id":"@beradrian/ngx-resource-core@5.4.1","_npmVersion":"6.4.1","_nodeVersion":"8.11.1","_npmUser":{"name":"beradrian","email":"beradrian@yahoo.com"},"dist":{"integrity":"sha512-hoE3Upp4UGqxExCGzgJxB2RipRBRwiUbFmH/bRQkKEUEikioKg8o6f7Odkf39M4PUlJf3YY/T/S+tBMIxCxiIQ==","shasum":"a934d42c5c8e2682c4c71dcee2102429cf02c0a2","tarball":"https://registry.npmjs.org/@beradrian/ngx-resource-core/-/ngx-resource-core-5.4.1.tgz","fileCount":25,"unpackedSize":197278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4/f2CRA9TVsSAnZWagAASaEQAJOfS8umtoH7iGxSlVIn\n/L+rQjFX+ChW04Lr+s0TdrOBj218dySZK3YKdb/YriRLPOemNWu/LFqlVhHf\ndhUJMQRwdBA48QfhMglg4O9zer5zo8gBG5+a6Q4PEUwxfAb0b7L5py1Caqam\nwqqNcyiNYL1bA+QWUzhN58xhN9ZJ2aUF2lj23Q/yLHw/odL1Ttk81E/nvfP6\nyXqxwYm3VxoKZedt3wcS5UwjsvL7Kw5MATU4MCIx9Ugc4aPi5NvqXgxQJ2P0\nZZ3gr51sIxoat9nboaBNcEXIbGAPxuaaroKUSe2RupIrmF3gRweYYyWLCEHm\nnucrK/2qcaE5o7rJj/pza4O2liWmcg8SEm/UO73b2ce+IsotTIswU+L7Z6Wr\nuh8Xned7dmsF+Rij+BrblVfx6VPAkJMA1DjnFPQRkc5zZTRzFc4WW+lf+GKN\nlDUm0UnacmIRxnUH1JEGaVtsS5bDGs3GeNzkiFAP7rMw8SUsjrlOUbdVRE4p\nFBf3tNCO8lY11bVBlpYNUlQag+w7jvb0fJjuO4zw3Zea1dWJXWY4Hza7QP4V\n5O0HOuKK69Dt4eUTBlQNu1/IrC85FNqelE1yT7GAWosX7kscvNtk+Tc6RxDW\nXAUGwUoTgBH4sq4hLCyZ7NlutiH5oEpDkBw3Ncr7dMseg148zm0QK6nnWps1\nVTpm\r\n=DZfd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDI8URXLrER0ipLMQQtxRSIFAdsv5iNWF6IK0LF0zwfVwIhAI0kelJPux+qZd2sdKlC1VPHVURqllwaZ+26cukk7Tyr"}]},"maintainers":[{"name":"beradrian","email":"beradrian@yahoo.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-resource-core_5.4.1_1541666805485_0.12134763516759994"},"_hasShrinkwrap":false},"5.4.2":{"name":"@beradrian/ngx-resource-core","version":"5.4.2","description":"Core of resource library","scripts":{"clean":"rimraf dist","lint":"tslint --config tslint.json --project tsconfig.json --type-check --format stylish","tsc":"tsc","webpack":"webpack","build":"npm run clean && npm run lint && npm run tsc && npm run webpack","build.full":"npm run build && cpx package.json dist/ && cpx README.md dist/","publish":"npm publish dist --access public"},"keywords":["ngx-resource","ngx-resource-core","ngx-resource-rest","ng2-resource","ng2-resource-rest","Angular2","Resource"],"repository":{"type":"git","url":"git+https://github.com/beradrian/ngx-resource-core.git"},"main":"bundles/core.umd.js","module":"index.js","typings":"index.d.ts","author":{"name":"Roman Rosluk","email":"roma@redbox.by"},"license":"MIT","bugs":{"url":"https://github.com/troyanskiy/ngx-resource-core/issues"},"devDependencies":{"@types/node":"^8.0.34","awesome-typescript-loader":"^3.2.3","clean-webpack-plugin":"^0.1.17","rimraf":"^2.6.2","tslint":"^5.7.0","typescript":"^2.5.3","webpack":"^3.12.0","cpx":"latest"},"homepage":"https://github.com/beradrian/ngx-resource-core#readme","_id":"@beradrian/ngx-resource-core@5.4.2","_npmVersion":"6.4.1","_nodeVersion":"8.11.1","_npmUser":{"name":"beradrian","email":"beradrian@yahoo.com"},"dist":{"integrity":"sha512-Xi5DtkIp1mB5hbdKowzev3lrt6sid/KpM7+Qk0WjMkLy2vJNbYWr5x/OdZ9+jQyJbrY8MBBjfXChVRIq6lgFUA==","shasum":"1b2db23b1d6818044fcaf622936c5119e2f9af86","tarball":"https://registry.npmjs.org/@beradrian/ngx-resource-core/-/ngx-resource-core-5.4.2.tgz","fileCount":25,"unpackedSize":198610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5CXWCRA9TVsSAnZWagAA2cUQAIAB00ZWJoUTNbnWhPab\nuv1skNFMwdOYN1tbXbFLr57DpGblghaTZY++5zAa/xZH13P8QX4SKnLYnX6p\nMmxYi65Ni182Jz6fofxkGX9wcPSEMAJEgcdiOg2d4CPiizNVsfJdfsksYrTT\nueIXCOXG049e+qlpgThCRAhmL7abTXKS2b8PcSqnRW2G+SuX5dle7KTl47VH\n1QziNMdBt558pgk2BK+9NOeLm7DOTnWWTrLPtPHvxrr8efPIJwkLLRS7nR7g\nDTkobRqFsopZ2EyBdX+VRvIG4/m0IDh2956X5eswhajjQlpLgZN4TImX7ZDv\nXp9tR55dWXGpqLEJJ2rk9YcKunWtqPgjrJr011o+V0zGWyWKXG6EG2MfDDEu\n6miPBYjBjDmhTWAaRrd4zSeCQ7dvvJgXozdWKeDhuAsqo/UTZ9kdqQ7dv8AB\nQoDfPzNEXcEt85EIlYHUuZ99W0KCi9YjtyTpBVqevHcz+Z46D2aw4x9/8lfS\nyRdylkRoMSmMr1nP4KtfzB69p1SwdzEjzM/5PbVn3y1I1PwHxrB5vxcVU6e1\n+8Pu4WPjtkEXD+x0UELQJB6diFJBYhtgLr1Y0syvX13c/eGN/t8AdPKhLIez\nnI65rWMZk7OoOs2bNy5ztJQxw+JJxDKUBDpZ4PbogieqkoEOzFuqJbW15R+y\n02Oh\r\n=bDnS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsauIGHHWI6U7k1E0PIvSb+Ouix715ySeZiqCc0kyJ/AIhAN3pOJz1/zacjXFPER7r6n92fttUzrojDOyK2Q7O52IY"}]},"maintainers":[{"name":"beradrian","email":"beradrian@yahoo.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-resource-core_5.4.2_1541678550056_0.3239514198421767"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-07T13:31:08.831Z","5.4.0":"2018-11-07T13:31:09.090Z","modified":"2022-04-04T18:28:43.425Z","5.4.1":"2018-11-08T08:46:45.613Z","5.4.2":"2018-11-08T12:02:30.233Z"},"maintainers":[{"name":"beradrian","email":"beradrian@yahoo.com"}],"description":"Core of resource library","homepage":"https://github.com/beradrian/ngx-resource-core#readme","keywords":["ngx-resource","ngx-resource-core","ngx-resource-rest","ng2-resource","ng2-resource-rest","Angular2","Resource"],"repository":{"type":"git","url":"git+https://github.com/beradrian/ngx-resource-core.git"},"author":{"name":"Roman Rosluk","email":"roma@redbox.by"},"bugs":{"url":"https://github.com/troyanskiy/ngx-resource-core/issues"},"license":"MIT","readme":"[![npm version](https://img.shields.io/npm/v/%40ngx-resource%2Fcore.svg)](https://www.npmjs.com/package/@ngx-resource/core)\n\n# @ngx-resource/core\nResource Core is an evolution of ngx-resource lib which provides flexibility for developers. Each developer can implement their own request handlers to easily customize the behavior.\nIn fact, `@ngx-resource/core` is an abstract common library which uses `ResourceHandler` to make requests, so it's even possible to use the lib on node.js server side with typescript. You just need to implement a `ResourceHandler` for it.\n\nAll my examples will be based on angular 4.4.4+\n\n### Known ResourceHandlers\n* [`@ngx-resource/handler-ngx-http`](https://github.com/troyanskiy/ngx-resource-handler-ngx-http). Based on `HttpClient` from `@angular/common/http`. Includes `ResourceModule.forRoot`.\n* [`@ngx-resource/handler-ngx-http-legacy`](https://github.com/troyanskiy/ngx-resource-handler-ngx-http-legacy). Based on `Http` from `@angular/http`. Includes `ResourceModule.forRoot`.\n* [`@ngx-resource/handler-cordova-advanced-http`](https://github.com/troyanskiy/ngx-resource-handler-cordova-advanced-http). Based on [Cordova Plugin Advanced HTTP](`https://github.com/silkimen/cordova-plugin-advanced-http`).\n* `@ngx-resource/handler-fetch`. Besed on [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). Not yet created.\n\n\n## Creation of Resource class\n\n```typescript\n@Injectable()\n@ResourceParams({\n  // IResourceParams\n  pathPrefix: '/auth'\n})\nexport class MyAuthResource extends Resource {\n\n  @ResourceAction({\n    // IResourceAction\n    method: ResourceRequestMethod.Post,\n    path: '/login'\n  })\n  login: IResourceMethod<{login: string, password: string}, IReturnData>; // will make an post request to /auth/login\n\n  @ResourceAction({\n    // IResourceAction\n    //method: ResourceRequestMethod.Get is by default\n    path: '/logout'\n  })\n  logout: IResourceMethod<void, void>;\n  \n  constructor(handler: ResourceHandler) {\n    super(handler);\n  }\n  \n}\n\n@Injectable()\n@ResourceParams({\n  // IResourceParams\n  pathPrefix: '/user'\n})\nexport class UserResource extends Resource {\n  \n  @ResourceAction({\n    path: '/{!id}'\n  })\n  getUser: IResourceMethod<{id: string}, IUser>; // will call /user/id\n  \n  @ResourceAction({\n    method: ResourceRequestMethod.Post\n  })\n  createUser: IResourceMethodStrict<IUser, IUserQuery, IUserPathParams, IUser>;\n  \n  @ResoucreAction({\n    path: '/test/data',\n    asResourceResponse: true\n  })\n  testUserRequest: IResourceMethodFull<{id: string}, IUser>; // will call /test/data and receive repsponse object with headers, status and body\n  \n  constructor(restHandler: ResourceHandler) {\n    super(restHandler);\n  }\n  \n}\n\n// Using created Resource\n@Injectable\nexport class MyService {\n  \n  private user: IUser = null;\n\n  constructor(private myResource: MyAuthResource, private userResource: UserResource) {}\n  \n  doLogin(login: string, password: string): Promise<any> {\n    return this.myResource.login({login, password});\n  }\n  \n  doLogout(): Promise<any> {\n    return this.myResource.logout();\n  }\n  \n  async loginAndLoadUser(login: string, password: string, userId: string): Promise<any> {\n    await this.doLogin(login, password);\n    this.user = await this.userResource.getUser({id: userId});\n  }\n  \n}\n\n```\n\nFinal url is generated by concatination of `$getUrl`, `$getPathPrefix` and `$getPath` methods of `Resource` base class.\n\n### [IResourceParams](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/Declarations.ts#L2-L23) \n\nIs used by `ResourceParams` decorator for class decoration\n\nList of params:\n* `url?: string;` - url of the api server; *default `''`*\n* `pathPrefix?: string;` - path prefix of the api; *default `''`*\n* `path?: string;` - path of the api; *default `''`*\n* `headers?: any;` - headers; *default `{}`*\n* `body?: any;` - default body; *default `null`*\n* `params?: any;` - default url params; *default `null`*\n* `query?: any;` - defualt query params; *default `null`*\n* `rootNode?: string;` - key to assign all body; *default `null`*\n* `removeTrailingSlash?: boolean;` - *default `true`*\n* `addTimestamp?: boolean | string;` - *default `false`*\n* `withCredentials?: boolean;` - *default `false`*\n* `lean?: boolean;` - do no add `$` properties on result. Used only with `toPromise: false` *default `false`*\n* `mutateBody?: boolean;` - if need to mutate provided body with response body. *default `false`*\n* `asPromise?: boolean;` - if method should return promise or object, which will be fullfilled after receiving response. *default `true`*\n* `asResourceResponse?: boolean;` - Receive `IResourceResponse` as a body . *default `false`*\n* `keepEmptyBody?: boolean;` - if need to keep empty body object `{}`\n* `requestBodyType?: ResourceRequestBodyType;` - request body type. *default: will be detected automatically*.\nCheck for possible body types in the sources of [ResourceRequestBodyType](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/Declarations.ts#L114-L122). Type detection algorithm [check here](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/ResourceHelper.ts#L12-L34).\n* `responseBodyType?: ResourceResponseBodyType;` - response body type. *default: `ResourceResponseBodyType.JSON`* Possible body type can be checked here [ResourceResponseBodyType](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/Declarations.ts#L124-L129).\n\n### [IResourceAction](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/Declarations.ts#L2-L31) \n\nIs used by `ResourceAction` decorator for methods.\n\nList of params (is all of the above) plus the following:\n* `method?: ResourceRequestMethod;` - method of request. *Default `ResourceRequestMethod.Get`*. All possible methods listed in [ResourceRequestMethod](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/Declarations.ts#L131-L139)\n* `expectJsonArray?: boolean;` - if expected to receive an array. The field is used only with `toPromise: false`. *Default `false`*.\n* `resultFactory?: IResourceResultFactory;` - custom method to create result object. *Default: `returns {}`*\n* `map?: IResourceResponseMap;` - custom data mapping method. *Default: `returns without any changes`*\n* `filter?: IResourceResponseFilter;` - custom data filtering method. *Default: `returns true`*\n\n### [ResourceGlobalConfig](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/ResourceGlobalConfig.ts)\nMainly used to set defaults.\n\n\n## Models\nAn object with built-in in methods to save, update, and delete a model.\nHere is an example of a `User` model.\n\nNote: UserResource should be injected at the beginning in order to use static\nmodel method like `User.get(<id>)`, `User.query()`, `User.remove(<id>)`\n\n```typescript\n\nexport interface IPaginationQuery {\n  page?: number;\n  perPage?: number;\n}\n\nexport interface IGroupQuery extends IPaginationQuery {\n  title?: string;\n}\n\nexport interface IUserQuery extends IPaginationQuery {\n  firstName?: string;\n  lastName?: string;\n  groupId?: number;\n}\n\nexport interface IUser {\n  id: number;\n  userName: string;\n  firstName: string;\n  lastName: string;\n  groupId: string;\n}\n\nexport class GroupResource extends ResourceCRUD<IGroupQuery, Group, Group> {\n  \n  constructor(restHandler: ResourceHandler) {\n    super(restHandler);\n  }\n  \n  $resultFactory(data: any, options: IResourceActionInner = {}): any {\n    return new Group(data);\n  }\n  \n}\n\nexport class Group extends ResourceModel {\n  \n  readonly $resource = GroupResource;\n\n  id: number;\n  title: string;\n  \n  constructor(data?: IGroup) {\n    super();\n    if (data) {\n      this.$setData(data);\n    }\n  }\n  \n  $setData(data: IGroup) {\n    this.id = data.id;\n    this.title = data.title;\n  }\n  \n}\n\nexport class UserResource extends ResourceCRUD<IUserQuery, User, User> {\n  \n  constructor(restHandler: ResourceHandler) {\n      super(restHandler);\n  }\n  \n  $resultFactory(data: any, options: IResourceActionInner = {}): any {\n    return new User(data);\n  }\n  \n}\n\nexport class User extends ResourceModel implements IUser {\n\n  readonly $resource = UserResource;\n\n  id: number;\n  userName: string;\n  firstName: string;\n  lastName: string;\n  groupId: string;\n  \n  fullName: string; // generated from first name and last name\n  \n  constructor(data?: IUser) {\n    super();\n    if (data) {\n      this.$setData(data);\n    }\n  }\n  \n  $setData(data: IUser): this {\n    Object.assign(this, data);\n    this.fullName = `${this.firstName} ${this.lastName}`;\n    return this;\n  }\n  \n  toJSON() {\n    // here i'm using lodash lib pick method.\n    return _.pick(this, ['id', 'firstName', 'lastName', 'groupId']);\n  }\n\n}\n\n\n// example of using the staff\nasync someMethodToCreateGroupAndUser() {\n\n  // Creation a group\n  const group = new Group();\n  group.title = 'My group';\n  \n  // Saving the group\n  await group.$save();\n  \n  // Creating an user\n  const user = new User({\n    userName: 'troyanskiy',\n    firstName: 'firstName',\n    lastName: 'lastName',\n    groupId: group.id\n  });\n  \n  // Saving the user\n  await user.$save();\n  \n  \n  // Query data from server\n  \n  const user1 = await this.userResource.get('1');\n  \n  // or\n  \n  const user2: User = await User.get('id');\n  \n}\n\n```\n\n\n## QueryParams Conversion\n\nYou can define the way query params are converted.\nSet the global config at the root of your app.\n\n`ResourceGlobalConfig.queryMappingMethod = ResourceQueryMappingMethod.<CONVERSION_STRATEGY>`\n\n```\n{\n  a: [{ b:1, c: [2, 3] }]\n}\n```\n\nWith `<CONVERSION_STRATEGY>` being one of the following:\n\n#### Plain (default)\nNo conversion at all\n\nOutput: `?a=[Object object]`\n\n#### Bracket\nAll array elements will be indexed\n\nOutput: `?a[0][b]=10383&a[0][c][0]=2&a[0][c][1]=3`\n\n#### JQueryParamsBracket \nImplements the standard $.params way of converting\n\nOutput: `?a[0][b]=10383&a[0][c][]=2&a[0][c][]=3`\n\n\n## Developing Resource Handler\n\nUse the [`ResourceHandler`](https://github.com/troyanskiy/ngx-resource-core/blob/master/src/ResourceHandler.ts) abstract class as parent to create your Handler. Check the sources of the class for the methods to implement.\n","readmeFilename":"README.md"}