Problem with *ngFor and panelMenu

UI Components for Angular
danielamas
Posts: 6
Joined: 14 Apr 2016, 22:34

14 Apr 2016, 22:56

Hi!

I have problem to use *ngFor with panelMenu, I want repeat <li> tag for each setor, but collapse doesn't work. This is the code:

Code: Select all

<p-panelMenu style="width:300px">
    <div>
        <div><a data-icon="fa fa-leaf"><span>Name</span></a></div>
            <div>
                <ul>
	            <li *ngFor="#setor of setors">
			  <a data-icon="fa-plus"><span>{{setor.name}}</span></a>
			  <ul>
				  <li><a><span>Equip 1</span></a></li>
				  <li><a><span>Equip 2</span></a></li>
			  </ul>
		  </li>
	    </ul>
        </div>
    </div>
</p-panelMenu>
But if I use this way the panel works:

Code: Select all

<p-panelMenu style="width:300px">
    <div>
        <div><a data-icon="fa fa-leaf"><span>Name</span></a></div>
            <div>
                <ul>
	            <li>
			  <a data-icon="fa-plus"><span>Setor1</span></a>
			  <ul>
				  <li><a><span>Equip 1</span></a></li>
				  <li><a><span>Equip 2</span></a></li>
			  </ul>
		    </li>
	            <li>
			  <a data-icon="fa-plus"><span>Setor2</span></a>
			  <ul>
				  <li><a><span>Equip 1</span></a></li>
				  <li><a><span>Equip 2</span></a></li>
			  </ul>
		    </li>
	    </ul>
        </div>
    </div>
</p-panelMenu>
Is it possible use *ngFor to repeat tag <li>????

Tks for all since now !!!!

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

14 Apr 2016, 22:57

In theory it should work, we'll check and get back to you.

danielamas
Posts: 6
Joined: 14 Apr 2016, 22:34

14 Apr 2016, 23:14

optimus.prime wrote:In theory it should work, we'll check and get back to you.
Tks optimus!!!

I'll try to use <p-tree> for while.

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

14 Apr 2016, 23:36

@Trypticon, please take over.

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

15 Apr 2016, 00:39

I'll replicate your problem and inform you about it.

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

15 Apr 2016, 09:32

Everything works fine locally can you please share your ts file.

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

18 Apr 2016, 00:05

Have you managed to get this working?

danielamas
Posts: 6
Joined: 14 Apr 2016, 22:34

18 Apr 2016, 15:54

optimus.prime wrote:Have you managed to get this working?
No, I don't try because my boss asked me about to use Tree and TreeNode...

danielamas
Posts: 6
Joined: 14 Apr 2016, 22:34

18 Apr 2016, 21:05

danielamas wrote:
optimus.prime wrote:Have you managed to get this working?
No, I don't try because my boss asked me about to use Tree and TreeNode...
But now I have a issue with TreeNode:

app/dashboard/dashboard-map.component.ts(13,35): error TS2304: Cannot find name 'TreeNode'

Code: Select all

10 import {TreeNode} from 'primeng/primeng';
11
12 @Component({
13 	directives: [MapComponent, Tree, TreeNode],
Can you help me??

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

18 Apr 2016, 22:39

Hi, directives:[UITreeNode] try this.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests