Page 1 of 2

ul app-submenu problem

Posted: 08 Mar 2017, 01:24
by vrmerlin
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?

Re: ul app-submenu problem

Posted: 10 Mar 2017, 09:14
by DarthMaul
Hi,

We will review the situation and get back to you.

Re: ul app-submenu problem

Posted: 10 Mar 2017, 09:41
by DarthMaul
Can you share your ts and HTML files please it seems correct right now.

Re: ul app-submenu problem

Posted: 13 Mar 2017, 17:59
by vrmerlin
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

Re: ul app-submenu problem

Posted: 13 Mar 2017, 18:23
by vrmerlin
I figured out the problem -- I hadn't added AppSubMenu as a dependency in the app.module.ts file.

Re: ul app-submenu problem

Posted: 13 Mar 2017, 19:17
by DarthMaul
Glad to hear that so your problem is solved?

Re: ul app-submenu problem

Posted: 13 Mar 2017, 20:24
by vrmerlin
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?

Re: ul app-submenu problem

Posted: 14 Mar 2017, 11:12
by DarthMaul
Which demo are you reffering to?

Re: ul app-submenu problem

Posted: 17 Mar 2017, 18:36
by vrmerlin
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).

Re: ul app-submenu problem

Posted: 20 Mar 2017, 12:23
by DarthMaul
Hi,

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