mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2989] updated documentation with multiple node example (#3328)
This commit is contained in:
@@ -111,7 +111,9 @@ to _alfresco-1002_ as follows:
|
||||
You then need to pass the node as the input `values` object with the other properties:
|
||||
|
||||
```ts
|
||||
let node: MinimalNodeEntryEntity = this.nodesApiService.getNode(NODE_ID);
|
||||
let node: MinimalNodeEntryEntity = null;
|
||||
|
||||
this.nodesApiService.getNode(NODE_ID).subscribe((minimalNode) => this.node = minimalNode);
|
||||
|
||||
const formValues: FormValues = {
|
||||
'file' : node
|
||||
@@ -119,6 +121,29 @@ const formValues: FormValues = {
|
||||
};
|
||||
```
|
||||
|
||||
You could pass multiple nodes too:
|
||||
|
||||
```ts
|
||||
const nodes: string[] = [NODE_ID_1, NODE_ID_2];
|
||||
|
||||
const values: FormValues = {
|
||||
'files': []
|
||||
};
|
||||
|
||||
Observable.from(nodes)
|
||||
.flatMap((nodeId) => this.nodesApiService.getNode(nodeId))
|
||||
.subscribe(
|
||||
(node) => {
|
||||
values.files.push(node);
|
||||
},
|
||||
(error) => console.log(error) ,
|
||||
() => {
|
||||
this.formValues = values;
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Note that in the object above, the key `file` is the name of the attach file field in the start form of the process. The value of the `file` property must be a
|
||||
[MinimalNodeEntryEntity](../content-services/document-library.model.md):
|
||||
|
||||
|
Reference in New Issue
Block a user