primeng

Is the entirety of PrimeNG imported when you use it, or is it tree shaken? How can I determine it by myself?

删除回忆录丶 提交于 2021-01-29 15:58:58
问题 I am looking at optimizing a work Angular project and we're currently looking at how we are using PrimeNG. The Tree Shaking section on Webpack's documentation (https://webpack.js.org/guides/tree-shaking/) says that it relies on the ES2015 module format to determine what code can be pruned away, since CommonJS cannot be statically analyzed. So, I assume that the Angular compiler has the same limitation since it uses Webpack on the build process. That being said, I was looking at PrimeNG's

How to display JSON data in a HTML table/list

喜欢而已 提交于 2021-01-29 07:05:18
问题 I would like to display the following JSON object in a table using Angular. The JSON object is not static (data can change from the server) JSON: { "This item has 1 value":1, "Another":30, "Item with multiple values":[ 1, 2, 3, 4, 5], "Another with multiple values":[ 45.5, 45.0, 44.7, 45.8, 45.9], "Single value":2, } And roughly how the data should be displayed (albeit not quite so ugly!): | Name | | | | | | |------------------------------|----|----|----|----|----| | This item has 1 value | 1

Styling PrimeNG p-tabView

馋奶兔 提交于 2021-01-28 06:35:34
问题 I fail to style the text of a PrimeNG TabView. Here's the Stackblitz showing the problem. What am I missing? 回答1: One way to solve your problem is to override PrimeNG class concerning tabview title : ui-tabview-title . So something like .ui-tabview-title { color: red; } should do the trick. Be sure to call that CSS after PrimeNG one. Edit You can apply CSS on first tab header with :first-child property : ul.ui-tabview-nav li:first-child span { color: red; } See working StackBlitz. 来源: https:/

Angular Unit Test of a PRIME ng confirmation service

旧城冷巷雨未停 提交于 2021-01-27 06:06:13
问题 First of all i am newbie at angular unit testing. I want to unit test the following method that removes a record from my data. The method is: //Confirm Button for deletion confirm(name: string, id: any) { this.confirmationService.confirm({ message: 'Are you sure you want to remove ' + name + ' from your list of Supporting Staff?', accept: () => { const index: number = this.data.indexOf(id); if (index !== -1) { this.data.splice(index,1); this.totalResults = this.data.length; this

Angular Unit Test of a PRIME ng confirmation service

£可爱£侵袭症+ 提交于 2021-01-27 06:06:12
问题 First of all i am newbie at angular unit testing. I want to unit test the following method that removes a record from my data. The method is: //Confirm Button for deletion confirm(name: string, id: any) { this.confirmationService.confirm({ message: 'Are you sure you want to remove ' + name + ' from your list of Supporting Staff?', accept: () => { const index: number = this.data.indexOf(id); if (index !== -1) { this.data.splice(index,1); this.totalResults = this.data.length; this

Angular Unit Test of a PRIME ng confirmation service

只愿长相守 提交于 2021-01-27 06:03:37
问题 First of all i am newbie at angular unit testing. I want to unit test the following method that removes a record from my data. The method is: //Confirm Button for deletion confirm(name: string, id: any) { this.confirmationService.confirm({ message: 'Are you sure you want to remove ' + name + ' from your list of Supporting Staff?', accept: () => { const index: number = this.data.indexOf(id); if (index !== -1) { this.data.splice(index,1); this.totalResults = this.data.length; this

Primeng captcha issue with angular 6

蓝咒 提交于 2021-01-27 04:41:13
问题 I am using primeng captcha with angular 6 and I have an issue. When I try to directly load the page that has captcha confirmation I have this error: ERROR TypeError: window.grecaptcha.render is not a function at Captcha.push../node_modules/primeng/components/captcha/captcha.js.Captcha.init (captcha.js:42) at Captcha.push../node_modules/primeng/components/captcha/captcha.js.Captcha.ngAfterViewInit (captcha.js:32) I have only initialized the captcha in my index.html: <script src="https://www

Why does usage of primeng p-radiobutton cause native Element error in Angular 9?

走远了吗. 提交于 2021-01-07 01:29:17
问题 I have a project which I have recently migrated to Angular 9 from Angular 8 . The project uses primeng version : 4.3.0 . Now the p-radiobutton tag is widely used through out the project to display radio buttons and it is not working properly . The p-radiobutton tag gives the runtime error : Unable to get property 'nativeElement' of undefined or null reference due to which , the UI gets distorted . The entire error stack trace is depicted down below : TypeError: Unable to get property

Why does usage of primeng p-radiobutton cause native Element error in Angular 9?

那年仲夏 提交于 2021-01-07 01:27:26
问题 I have a project which I have recently migrated to Angular 9 from Angular 8 . The project uses primeng version : 4.3.0 . Now the p-radiobutton tag is widely used through out the project to display radio buttons and it is not working properly . The p-radiobutton tag gives the runtime error : Unable to get property 'nativeElement' of undefined or null reference due to which , the UI gets distorted . The entire error stack trace is depicted down below : TypeError: Unable to get property

Prime-NG P-CHIPS Numbers only for Array of Numbers

*爱你&永不变心* 提交于 2021-01-05 07:27:20
问题 How can I enforce user to enter only numbers using p-chips component? I want to fill array of numbers from user input. Is there any alternative way to achieve this other than p-chips component? 回答1: By using p-chips component, you can use onAdd method to check user input : HTML <p-chips [(ngModel)]="values" (onAdd)=checkInput($event)></p-chips> TS checkInput(event) { this.errorMessage = ''; // reinitialize error message if(!this.isInt(event.value)) { this.errorMessage = event.value + ' is not