Skip to content

Commit

Permalink
Merge pull request primefaces#13188 from volvachev/fix-picklist-demo
Browse files Browse the repository at this point in the history
fix(primeng/p-pickList): documentation not render data
  • Loading branch information
gucal authored Jun 13, 2023
2 parents 039f3e2 + befa1e4 commit 6fd8a21
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
21 changes: 15 additions & 6 deletions src/app/showcase/doc/picklist/basicdoc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core';
import { ChangeDetectorRef, Component, Input } from '@angular/core';
import { Code } from '../../domain/code';
import { Product } from '../../domain/product';
import { ProductService } from '../../service/productservice';
Expand Down Expand Up @@ -48,10 +48,13 @@ export class BasicDoc {

targetProducts: Product[];

constructor(private carService: ProductService) {}
constructor(private carService: ProductService, private cdr: ChangeDetectorRef) {}

ngOnInit() {
this.carService.getProductsSmall().then((products) => (this.sourceProducts = products));
this.carService.getProductsSmall().then((products) => {
this.sourceProducts = products;
this.cdr.markForCheck();
});
this.targetProducts = [];
}

Expand Down Expand Up @@ -95,7 +98,7 @@ export class BasicDoc {
</div>`,

typescript: `
import { Component } from '@angular/core';
import { ChangeDetectorRef, Component } from '@angular/core';
import { Product } from '../../domain/product';
import { ProductService } from '../../service/productservice';
Expand All @@ -108,10 +111,16 @@ export class PicklistBasicDemo {
targetProducts: Product[];
constructor(private carService: ProductService) {}
constructor(
private carService: ProductService,
private cdr: ChangeDetectorRef
) {}
ngOnInit() {
this.carService.getProductsSmall().then((products) => (this.sourceProducts = products));
this.carService.getProductsSmall().then(products => {
this.sourceProducts = products;
this.cdr.markForCheck();
});
this.targetProducts = [];
}
}`,
Expand Down
21 changes: 15 additions & 6 deletions src/app/showcase/doc/picklist/filterdoc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core';
import { ChangeDetectorRef, Component, Input } from '@angular/core';
import { Code } from '../../domain/code';
import { Product } from '../../domain/product';
import { ProductService } from '../../service/productservice';
Expand Down Expand Up @@ -51,10 +51,13 @@ export class FilterDoc {

targetProducts: Product[];

constructor(private carService: ProductService) {}
constructor(private carService: ProductService, private cdr: ChangeDetectorRef) {}

ngOnInit() {
this.carService.getProductsSmall().then((products) => (this.sourceProducts = products));
this.carService.getProductsSmall().then((products) => {
this.sourceProducts = products;
this.cdr.markForCheck();
});
this.targetProducts = [];
}

Expand Down Expand Up @@ -98,7 +101,7 @@ export class FilterDoc {
</div>`,

typescript: `
import { Component } from '@angular/core';
import { Component, ChangeDetectorRef } from '@angular/core';
import { Product } from '../../domain/product';
import { ProductService } from '../../service/productservice';
Expand All @@ -111,10 +114,16 @@ export class PicklistFilterDemo {
targetProducts: Product[];
constructor(private carService: ProductService) {}
constructor(
private carService: ProductService,
private cdr: ChangeDetectorRef
) {}
ngOnInit() {
this.carService.getProductsSmall().then((products) => (this.sourceProducts = products));
this.carService.getProductsSmall().then(products => {
this.sourceProducts = products;
this.cdr.markForCheck();
});
this.targetProducts = [];
}
}`,
Expand Down

0 comments on commit 6fd8a21

Please sign in to comment.