PageManager

page/manager/PageManager~ PageManager

The page manager is a utility for managing the current controller and its view.

Constructor

new PageManager()

Source:

Methods

destroy()

Source:
Finalization callback, called when the page manager is being discarded. This usually happens when the page is hot-reloaded at the client side.

init()

Source:
Initializes the page manager.

manage(controller, view, options, paramsopt) → {Promise.<{status: number, content: ?string, pageState: Object.<string, *>}>}

Source:
Starts to manage the provided controller and its view. The manager stops the management of any previously managed controller and view. The controller and view will be initialized and rendered either into the UI (at the client-side) or to the response to send to the client (at the server-side).
Parameters:
Name Type Attributes Default Description
controller string | function The alias, namespace path, or constructor of the controller to manage.
view string | function The alias, namespace path, or constructor of the page view to manage.
options Object The current route options.
params Object.<string, string> <optional>
{} The route parameters of the current route.
Returns:
A promise that will resolve to information about the rendered page. The status will contain the HTTP status code to send to the client (at the server side) or determine the type of error page to navigate to (at the client side). The content field will contain the rendered markup of the page at the server-side, or null at the client-side.
Type
Promise.<{status: number, content: ?string, pageState: Object.<string, *>}>

scrollTo(xopt, yopt)

Source:
Scrolls the viewport to the specified horizontal and vertical offset. This method has no effect at the server-side.
Parameters:
Name Type Attributes Default Description
x number <optional>
0 The horizontal offset to scroll to.
y number <optional>
0 The vertical offset to scroll to.