mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[no issue number] fix unsubscribing in documentlist (#2740)
* fix unsubscribing in documentlist * fix tslint errors
This commit is contained in:
@@ -19,7 +19,7 @@ import { Component, ViewChild } from '@angular/core';
|
||||
import { FormComponent, FormModel, FormService, LogService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'form-list',
|
||||
selector: 'app-form-list',
|
||||
templateUrl: 'form-list.component.html',
|
||||
styleUrls: ['form-list.component.scss']
|
||||
})
|
||||
@@ -45,10 +45,10 @@ export class FormListComponent {
|
||||
}
|
||||
|
||||
onRowDblClick(event: CustomEvent) {
|
||||
let rowForm = event.detail.value.obj;
|
||||
const rowForm = event.detail.value.obj;
|
||||
|
||||
this.formService.getFormDefinitionById(rowForm.id).subscribe((formModel) => {
|
||||
let form = this.formService.parseForm(formModel.formDefinition);
|
||||
const form = this.formService.parseForm(formModel.formDefinition);
|
||||
this.form = form;
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@ export class FormListComponent {
|
||||
}
|
||||
|
||||
clone(objToCopyFrom, objToCopyTo) {
|
||||
for (let attribute in objToCopyFrom) {
|
||||
for (const attribute in objToCopyFrom) {
|
||||
if (objToCopyFrom.hasOwnProperty(attribute)) {
|
||||
objToCopyTo[attribute] = objToCopyFrom[attribute];
|
||||
}
|
||||
|
@@ -16,14 +16,14 @@
|
||||
*/
|
||||
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormModel, FormService } from '@alfresco/adf-core';
|
||||
import { FormModel, FormService, FormOutcomeEvent } from '@alfresco/adf-core';
|
||||
import { InMemoryFormService } from '../../services/in-memory-form.service';
|
||||
import { DemoForm } from './demo-form';
|
||||
|
||||
@Component({
|
||||
selector: 'form',
|
||||
selector: 'app-form',
|
||||
templateUrl: 'form.component.html',
|
||||
styleUrls: [ 'form.component.css' ],
|
||||
styleUrls: ['form.component.css'],
|
||||
providers: [
|
||||
{ provide: FormService, useClass: InMemoryFormService }
|
||||
]
|
||||
@@ -33,14 +33,13 @@ export class FormComponent implements OnInit {
|
||||
form: FormModel;
|
||||
|
||||
constructor(@Inject(FormService) private formService: InMemoryFormService) {
|
||||
formService.executeOutcome.subscribe(e => {
|
||||
e.preventDefault();
|
||||
console.log(e.outcome);
|
||||
formService.executeOutcome.subscribe((formOutcomeEvent: FormOutcomeEvent) => {
|
||||
formOutcomeEvent.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
let formDefinitionJSON: any = DemoForm.getDefinition();
|
||||
const formDefinitionJSON: any = DemoForm.getDefinition();
|
||||
this.form = this.formService.parseForm(formDefinitionJSON);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user