ul app-submenu problem

vrmerlin
Posts: 24
Joined: 17 Nov 2016, 23:53

08 Mar 2017, 01:24

I'm trying to imitate the Demo site for Ultima NG, and have added this to my component template:

Code: Select all

<ul app-submenu [item]="menuAppItems" root="true" class="ultima-menu ultima-main-menu clearfix" [reset]="reset" visible="true"></ul>
In my component, I have:

Code: Select all

private appMenuItems: MenuItem[];
When I run the code, I get this error:

Code: Select all

Can't bind to 'item' since it isn't a known property of 'ul'
What am I missing from my code?

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

10 Mar 2017, 09:14

Hi,

We will review the situation and get back to you.

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

10 Mar 2017, 09:41

Can you share your ts and HTML files please it seems correct right now.

vrmerlin
Posts: 24
Joined: 17 Nov 2016, 23:53

13 Mar 2017, 17:59

This is a rather large project -- not sure how I would share all the files? For this particular component, what I did was grab the latest Ultima (although the same problem happens with the latest Poseidon as well), copied the exact contents of app.menu.component.ts (HTML is a template) into a file called gui-mgr.component.ts, and renamed AppMenuComponent to GuiMgrComponent. I'm getting no errors when I do "ng build", but get an output, in the browser, of:

Code: Select all

Can't bind to 'item' since it isn't a known property of 'ul'. ("
        <ul app-submenu [ERROR ->][item]="model" root="true" class="layout-menu clearfix" [reset]="reset" visible="true"></ul>
    "): GuiMgrComponent@1:24
I looked through the package.json files, and noticed that my @angular dependencies match up perfectly (all ~2.4.0), but that the devDependencies are a bit different. You have (in Poseidon 1.0.1):

Code: Select all

    "@angular/cli": "1.0.0-beta.30",
    "@angular/compiler-cli": "^2.3.1",
where I have:

Code: Select all

    "@angular/cli": "1.0.0-rc.0",
    "@angular/compiler-cli": "^2.4.0",
I tried to match yours but got a strange build error, I think because then there was a mismatch with my global install of @angular-cli (I have 1.0.0-beta.32.3 installed globally). I tried, in package.json, 1.0.0-beta.32.3 (my global install) and 2.3.1, and it built fine, but produced the same error as above. What kind of problems would produce the error I'm seeing?

John

vrmerlin
Posts: 24
Joined: 17 Nov 2016, 23:53

13 Mar 2017, 18:23

I figured out the problem -- I hadn't added AppSubMenu as a dependency in the app.module.ts file.

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

13 Mar 2017, 19:17

Glad to hear that so your problem is solved?

vrmerlin
Posts: 24
Joined: 17 Nov 2016, 23:53

13 Mar 2017, 20:24

Yes, that problem is resolved, except now I am getting a different failure: "No provider for Renderer!". I'm using the Renderer just like the demo does. If I try to add it to the list of providers for my NgModule, it doesn't even compile (Type 'typeof Renderer' is not assignable to type 'Provider'). How can I get rid of that error?

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

14 Mar 2017, 11:12

Which demo are you reffering to?

vrmerlin
Posts: 24
Joined: 17 Nov 2016, 23:53

17 Mar 2017, 18:36

I used the demo page that comes with the download, but was attempting to put too much behavior in a subcomponent, rather than AppComponent. When I moved the Renderer to the AppComponent constructor, then it worked ok (although I'm not sure why I couldn't import it into a subcomponent).

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

20 Mar 2017, 12:23

Hi,

Is it working for you when you moved your functionality to the AppComponent?

Post Reply

Return to “Ultima - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest