mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
Update working-with-nodes-api-service.md (#5337)
This commit is contained in:
parent
da3a51dbed
commit
f5b6676bcd
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
Title: Working with the Nodes API service
|
Title: Working with the Nodes API service
|
||||||
Level: Intermediate
|
Level: Intermediate
|
||||||
|
Last reviewed: 2019-12-17
|
||||||
---
|
---
|
||||||
|
|
||||||
# Working with the Nodes API Service
|
# Working with the Nodes API Service
|
||||||
@ -32,18 +33,11 @@ _how-to_ description in
|
|||||||
[preparation of the development environment](./preparing-environment.md).
|
[preparation of the development environment](./preparing-environment.md).
|
||||||
|
|
||||||
When you have the Alfresco Example Content Application up and running, edit the `FileComponent`
|
When you have the Alfresco Example Content Application up and running, edit the `FileComponent`
|
||||||
defined in `src/app/components/files/files.component.ts`. Change the `onNodeDoubleClick` method
|
defined in `src/app/components/files/files.component.ts`. Change the `navigateTo` method
|
||||||
to match the source code below.
|
to match the source code below.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
if (PageComponent.isLockedNode(node)) {
|
if (node.isFile) {
|
||||||
...
|
|
||||||
} else if (node.isFile) {
|
|
||||||
|
|
||||||
// Comment the line below.
|
|
||||||
// this.router.navigate(['./preview', node.id], { relativeTo: this.route });
|
|
||||||
|
|
||||||
// Add this line.
|
|
||||||
this.myOnNodeDoubleClick(node.id);
|
this.myOnNodeDoubleClick(node.id);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -134,18 +128,12 @@ other visual component) then the principle is the same.
|
|||||||
## Retrieving the node's children
|
## Retrieving the node's children
|
||||||
|
|
||||||
Another common use of the [`NodesApiService`](../core/services/nodes-api.service.md) is to retrieve a list of the children of a folder node.
|
Another common use of the [`NodesApiService`](../core/services/nodes-api.service.md) is to retrieve a list of the children of a folder node.
|
||||||
Edit `src/app/components/files/files.component.ts` again, changing the `onNodeDoubleClick` method
|
Edit `src/app/components/files/files.component.ts` again, changing the `navigateTo` method
|
||||||
to match the source code below:
|
to match the source code below:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
if (node.isFolder) {
|
if (node.isFolder) {
|
||||||
|
|
||||||
// Comment the line below.
|
|
||||||
// this.navigate(node.id);
|
|
||||||
|
|
||||||
// Add this line.
|
|
||||||
this.myOnFolderNodeDoubleClick(node.id);
|
this.myOnFolderNodeDoubleClick(node.id);
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user