Where or how does the function defined?

How does this line work? I can not find where the method defined or how the function defined.

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/models/nav-item.js.es6#L110

I mean if i want to add a top-menu, how does it works?

I believe top menu is a string in the format: “first|second|third|fourth”

IE, a pipe delimited array in a string.

To add a top-menu item use this:

https://meta.discourse.org/t/adding-items-to-navigation-bar/26830/8?u=falco

3 Likes