Skip to content

Commit

Permalink
fix(primeng/p-pickList): documentation not render data
Browse files Browse the repository at this point in the history
volvachev committed Jun 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 5b5b95d commit befa1e4
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';
@@ -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 = [];
}

@@ -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';
@@ -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 = [];
}
}`,
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';
@@ -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 = [];
}

@@ -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';
@@ -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 = [];
}
}`,

0 comments on commit befa1e4

Please sign in to comment.