mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-18 19:07:12 +00:00
71 lines
3.1 KiB
Markdown
71 lines
3.1 KiB
Markdown
# Using PnP JS Core custom objects with @select and @expand decorators
|
|
|
|
## Summary
|
|
This web part demonstrates how to use [PnP JS Core](https://github.com/SharePoint/PnP-JS-Core) Custom Objects with @select and @expand TypeScript decorators.
|
|
If you are going to use PnP JS Core library and you've plans for [extending it with Custom Business Objects](https://github.com/SharePoint/PnP-JS-Core/wiki/Extending-with-Custom-Business-Objects), then this project will show you some best practices.
|
|
You can also find more information in the [blog series about working with Custom Business Objects, Parsers and TypeScript Decorators in PnP JS Core](https://blog.josequinto.com/2017/05/19/why-do-we-should-use-custom-business-objects-models-in-pnp-js-core/)
|
|
|
|
|
|
## Compatibility
|
|
|
|
This sample is designed to be used in the following enviroments:
|
|
|
|

|
|

|
|

|
|

|
|
-Compatible-green.svg)
|
|

|
|

|
|

|
|
|
|
|
|
For more information about SPFx compatibility, please refer to https://aka.ms/spfx-matrix
|
|
|
|
|
|
|
|
## Applies to
|
|
* [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
|
|
* [Office 365 developer tenant](https://learn.microsoft.com/sharepoint/dev/spfx/set-up-your-developer-tenant)
|
|
|
|
## Solution
|
|
|
|
Solution|Author(s)
|
|
--------|---------
|
|
react-sp-pnp-js-property-decorators | Jose Quinto ([@jquintozamora](https://twitter.com/jquintozamora) , [blog.josequinto.com](https://blog.josequinto.com))
|
|
|
|
## Version history
|
|
|
|
Version|Date|Comments
|
|
-------|----|--------
|
|
1.0|July 2, 2017|Initial release
|
|
|
|
|
|
## Disclaimer
|
|
|
|
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
|
|
|
|
|
|
|
## Minimal Path to Awesome
|
|
- clone this repo
|
|
- `$ npm i`
|
|
- `$ gulp trust-dev-cert`
|
|
- `$ gulp serve `
|
|
|
|
> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit https://aka.ms/spfx-devcontainer for further instructions.
|
|
|
|
### Local Mode
|
|
A browser in local mode (localhost) will be opened.
|
|
https://localhost:4321/temp/workbench.html
|
|
|
|
### SharePoint Mode
|
|
If you want to try on a real environment, open:
|
|
https://your-domain.sharepoint.com/_layouts/15/workbench.aspx
|
|
|
|
|
|
|
|
|
|
|
|
<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/react-sp-pnp-js-property-decorators" />
|