Cannot read property 'trim' of undefined

UI Components for Angular
Post Reply
retarderko
Posts: 2
Joined: 26 Jun 2021, 19:33

26 Jun 2021, 19:37

Code: Select all

 <button pButton pRipple type="button" label="{{'signup' | translate}}" class="p-button-outlined btn "></button>
So basically translation is proceeding, but im getting this error in console,
Cannot read property 'trim' of undefined
Image

I tried to do same thing with input and it worket as it should have.

avmesquita
Posts: 1
Joined: 29 Apr 2021, 17:13

04 Aug 2021, 11:32

Occurred with me when using ngx-translate.

To resolve the bug, momentarily use:

icon="pi"

like:

<button pButton icon="pi" label="{{ 'CONSTANT' | translate }} ...>

Mc128k
Posts: 10
Joined: 08 Jan 2018, 00:21

06 Aug 2021, 00:15

Having the same bug with a dynamic label. Is this already notified in github?

spiceagent11
Posts: 2
Joined: 30 Jul 2021, 16:52

09 Aug 2021, 18:55

I'd much prefer, however, if whatever was currently selected was always automatically scrolled into view when the dropdown drops. Is there way to do this?

Flavien
Posts: 1
Joined: 14 Sep 2021, 11:16

14 Sep 2021, 11:19

I had the same issue, the problem came when the label attribute changed i.e. if it was bound to a hot observable

Replace

Code: Select all

<button  [label]="yourObservable$ | async | translate"></button>
with:

Code: Select all

<button>{{yourObservable$ | async | translate}}</button>

kakkadu
Posts: 1
Joined: 24 Sep 2021, 08:41

24 Sep 2021, 08:46

What helped in my case:
Use

Code: Select all

<p-button></p-button>
instead of

Code: Select all

<button pButton type="button"></button>
or you have to declare icon as already mentioned above.

mpscheidt
Posts: 3
Joined: 03 Dec 2018, 10:23

18 Oct 2021, 11:38


Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests