newdevs:angular_making_calls
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
newdevs:angular_making_calls [2023/12/12 19:26] – add a netservice retrieve example sandbergja | newdevs:angular_making_calls [2024/03/28 22:53] – [Updating data in the database] add pcrud example sandbergja | ||
---|---|---|---|
Line 137: | Line 137: | ||
===== Updating data in the database ===== | ===== Updating data in the database ===== | ||
+ | ==== PcrudService example ==== | ||
- | Examples coming soon | + | The basic workflow for updating data in the database is to: |
+ | - Retrieve the object you wish to change. | ||
+ | - Make your changes in memory. | ||
+ | - Use the Pcrud service' | ||
+ | |||
+ | The following example retrieves the item with ID #1, changes its barcode to 1234567 in memory, then saves the updated barcode to the database: | ||
+ | |||
+ | this.pcrud.retrieve(' | ||
+ | .pipe(switchMap((item) => { | ||
+ | item.barcode(' | ||
+ | return this.pcrud.update(item); | ||
+ | })).subscribe(); | ||
+ | |||
+ | Notice that we use the rxjs '' | ||
+ | |||
+ | |||
+ | ==== NetService example ==== | ||
+ | |||
+ | coming soon | ||
===== Deleting data in the database ===== | ===== Deleting data in the database ===== | ||
newdevs/angular_making_calls.txt · Last modified: 2024/03/28 23:16 by sandbergja