Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kbnTopNav] break out controller, allow implementors to pass it in #6752

Merged
merged 2 commits into from
Apr 4, 2016

Commits on Apr 2, 2016

  1. [kbnTopNav] break out controller, allow implementors to pass it in

    The first iteration of `kbnTopNav` prevented the need to define a `configTemplate` and the `menuItems` in separate locations, but moved the external API to a `kbnTopNav` object that was exposed on the scope where `kbnTopNav` was rendered. This meant that in order to programmatically control the `kbnTopNav` other directives needed to share a scope with it, or inherit from its scope. Additionally, since the `kbnTopNav` object is potentially not available when other directives boot, all access to this object needed to be wrapped in a call to `$timeout`.
    
    In order to prevent this, but keep the nice API of `kbnTopNav`, this change breaks the controller and it's API out of `kbnTopNav` and exposes it via a Private module. Now, implementors can instantiate the `KbnTopNavController` themselves and pass it into the `<kbn-top-nav>` directive via the config attribute. This allows implementors to store the topNav API wherever makes sense in their implementation.
    
    When the config attribute is not already an instance of the `KbnTopNavController` the directive will create an instance out of the passed value, which means that no existing implementations need to change at all.
    spalger committed Apr 2, 2016
    Configuration menu
    Copy the full SHA
    9924a58 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ded3e79 View commit details
    Browse the repository at this point in the history