Page tree

Have questions? Stuck? Please check our FAQ for some common questions and answers.

Skip to end of metadata
Go to start of metadata

NavService - Navigation Service

NavService is an Angular Factory in the Nav module with the name nav.js. It provides functions to control the navigation pane and navigating between views. To use these functions, see the documentation oninjecting Angular services.

ONOS Navigation Pane:

NameSummary
showNavShow the navigation pane.
hideNavHide the navigation pane.
toggleNavToggle the navigation pane between shown and hidden.
hideIfShownHides the navigation if it is shown.
navToNavigate to the given path with optional query parameters.

Function Descriptions

showNav

Show the navigation pane.

Example UsageArgumentsReturn Values
ns.showNav();nonenone

hideNav

Hide the navigation pane.

Example UsageArgumentsReturn Values
ns.hideNav();nonenone

toggleNav

Toggle the navigation pane between shown and hidden. If the navigation pane is shown, then the pane will toggle to hidden, and vice versa.

Example UsageArgumentsReturn Values
ns.toggleNav();nonenone

hideIfShown

Hides the navigation pane if it is shown.

Example UsageArgumentsReturn Values
ns.hideIfShown();none

true - if the pane was changed to hidden

false - if the pane was already hidden

navTo

Navigate to the given path (within the ONOS GUI views) with optional query parameters.

Example UsageArgumentsReturn Values
ns.navTo(path, params);

path - the path to navigate to (without the first slash)

params - an object with a list of the query parameters you want in the URL

none, but the page will navigate to the new GUI view

For example, to navigate to the Foo View with a query parameter of bar:

ns.navTo('foo', { bar: baz });

This will navigate to the URL: http://<DOMAIN>:<PORT>/onos/ui/index.html#/foo?bar=baz

  • No labels