Error in your sample of MegaMenu with PrimeNG 4.1.3

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
lne
Posts: 48
Joined: 30 Mar 2017, 08:47

21 Aug 2017, 07:26

Your sample

Code: Select all

this.items = [
                {
                    label: 'TV', icon: 'fa-check',
                    items: [
                        [
                            {
                                label: 'TV 1',
                                items: [{label: 'TV 1.1'},{label: 'TV 1.2'}]
                            },
                            {
                                label: 'TV 2',
                                items: [{label: 'TV 2.1'},{label: 'TV 2.2'}]
                            }
                        ],
                        [
                            {
                                label: 'TV 3',
                                items: [{label: 'TV 3.1'},{label: 'TV 3.2'}]
                            },
                            {
                                label: 'TV 4',
                                items: [{label: 'TV 4.1'},{label: 'TV 4.2'}]
                            }    
                        ]
                    ]
                },
                {
                    label: 'Sports', icon: 'fa-soccer-ball-o',
                    items: [
                        [
                            {
                                label: 'Sports 1',
                                items: [{label: 'Sports 1.1'},{label: 'Sports 1.2'}]
                            },
                            {
                                label: 'Sports 2',
                                items: [{label: 'Sports 2.1'},{label: 'Sports 2.2'}]
                            },

                        ],
                        [
                            {
                                label: 'Sports 3',
                                items: [{label: 'Sports 3.1'},{label: 'Sports 3.2'}]
                            },
                            {
                                label: 'Sports 4',
                                items: [{label: 'Sports 4.1'},{label: 'Sports 4.2'}]
                            }
                        ],
                        [
                            {
                                label: 'Sports 5',
                                items: [{label: 'Sports 5.1'},{label: 'Sports 5.2'}]
                            },
                            {
                                label: 'Sports 6',
                                items: [{label: 'Sports 6.1'},{label: 'Sports 6.2'}]
                            }
                        ]
                    ]
                }
            ];
generate an error

severity: 'Erreur'
message: 'Type '{ label: string; icon: string; items: { label: string; items: { label: string; }[]; }[][]; }[]' is not assignable to type 'MenuItem[]'.
Type '{ label: string; icon: string; items: { label: string; items: { label: string; }[]; }[][]; }' is not assignable to type 'MenuItem'.
Types of property 'items' are incompatible.
Type '{ label: string; items: { label: string; }[]; }[][]' is not assignable to type 'MenuItem[]'.
Type '{ label: string; items: { label: string; }[]; }[]' has no properties in common with type 'MenuItem'.'

merve7
Posts: 861
Joined: 12 Sep 2017, 10:44

13 Nov 2017, 13:02

We fixed in previous versions. Please can you check again?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

01 Dec 2017, 10:58

Try with PrimeNG 5.0 please, it was fixed, you need Angular 5 though for that.

kerisaa
Posts: 1
Joined: 18 Sep 2022, 12:52

18 Sep 2022, 12:54

I've had this problem before,MegaMenu with PrimeNG 4.1.3 the fix is pretty simple.
trt spor canlı

seymagullu
Posts: 44
Joined: 17 Jun 2022, 09:43

04 Oct 2022, 09:05

Hi,

I am glad that the problem has been resolved.
Thank you.

Regards.

Post Reply

Return to “Barcelona - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests