[ADF-4976] Fix variable being referenced before initialization (#4977)

This commit is contained in:
georg-un 2019-08-19 23:01:58 +02:00 committed by Eugenio Romano
parent 023476e14f
commit f3ab69474d

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core';
import { Component, ViewEncapsulation, EventEmitter, Input, Output, OnInit } from '@angular/core';
import { NodeEntry, Node } from '@alfresco/js-api';
import { NodePermissionService } from '../../services/node-permission.service';
import { NodesApiService, ContentService, AllowableOperationsEnum } from '@alfresco/adf-core';
@ -26,7 +26,7 @@ import { NodesApiService, ContentService, AllowableOperationsEnum } from '@alfre
styleUrls: ['./add-permission.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class AddPermissionComponent {
export class AddPermissionComponent implements OnInit {
/** ID of the target node. */
@Input()
@ -46,7 +46,9 @@ export class AddPermissionComponent {
constructor(private nodePermissionService: NodePermissionService,
private nodeApiService: NodesApiService,
private contentService: ContentService) {
private contentService: ContentService) { }
ngOnInit(): void {
this.nodeApiService.getNode(this.nodeId).subscribe((node) => this.currentNode = node);
}