r/Angular2•
DanJSum

Semantic UI script-aware elements (dropdowns) in templates

Help Request

TL;DR - skip to the last paragraph

I am in the process of learning Angular 2 (having no prior Angular experience, but a lot of other web dev experience). I've done the quick start and the Tour of Heroes, and I'm now trying to convert an existing app (from ASP MVC 4). I've gotten the structure put together, and am excited about how easy this framework makes development.

The challenge I'm facing right now has to do with the navigation menu at the top. I'm implementing something similar to the second example under the "Menu" heading at this Semantic UI example, but the drop down doesn't drop down. All of the navigation stuff is in app.component.html (the top-level component), but the Semantic UI and jQuery scripts are being loaded in index.html (the base file where all the other Angular stuff is pulled in).

I suspect that the issue is that the content within app.component.html is being rendered after the initial "scan the page and wire everything up" events have fired. I did some searching, and the answer seems to be "use a directive." Now, I agree that all that navigation code probably doesn't belong where I've currently got it, but what I haven't been able to figure out is how that would help.

Is there a way to trigger the document ready events again, once a component's contents have rendered? And, if "use a directive" is the answer, could you point to a place that details what I'd need to put in the directive to get this to work? Many thanks...

Posted Mar 13, 2016, 1:13 PM UTC

10

No comments yet

Nobody commented on this post, or the comments weren't captured.