new PageManager()
Methods
-
destroy()
-
Finalization callback, called when the page manager is being discarded. This usually happens when the page is hot-reloaded at the client side.
-
init()
-
Initializes the page manager.
-
manage(controller, view, options [, params])
-
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 Argument 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). Thecontent
field will contain the rendered markup of the page at the server-side, ornull
at the client-side.- Type
- Promise.<{status: number, content: ?string, pageState: Object.<string, *>}>
-
scrollTo( [x] [, y])
-
Scrolls the viewport to the specified horizontal and vertical offset.
This method has no effect at the server-side.
Parameters:
Name Type Argument Default Description x
number <optional>
0 The horizontal offset to scroll to.
y
number <optional>
0 The vertical offset to scroll to.