Class: Page

Page

Page

Constructor

new Page(definition)

A Page represents one of the main application pages.

Parameters:
Name Type Description
definition Page~PageDefinition
Source:

Methods

$component(definition) → {Component}

Adds a Component to the page

Parameters:
Name Type Description
definition Component~ComponentDefinition
Source:
Returns:
Type
Component

$view(definition) → {View}

Adds a View to a Page

Parameters:
Name Type Description
definition View~ViewDefinition
Source:
Returns:
Type
View

at()

Performs an expectation on whether the browser is at the path defined for a Page

Source:

goTo(pathOrRequestopt, requestopt)

Parameters:
Name Type Attributes Description
pathOrRequest String <optional>

the path to navigate to relative to this page

request Object <optional>

a map of params to add to path as a query string

Source:
Example
//todo/edit?id=foo
Todo.goTo("edit", {id: 'foo'});

goTo(pathOrRequestopt)

Parameters:
Name Type Attributes Description
pathOrRequest Object <optional>

a map of params to add to path as a query string

Source:
Example
// /todo?priority=high
Todo.goTo({priority: 'high'});

goTo(pathOrRequestopt)

Use to navigate within the views for a Page.

Parameters:
Name Type Attributes Description
pathOrRequest String <optional>

the path to navigate to relative to this page

Source:
Example
// /todo/create
Todo.goTo("create");

Type Definitions

PageDefinition

The definition object for a Page

Type:
  • Object
Properties:
Name Type Attributes Description
name String

the name of the page

path String

the relative path to this page

params Object

a map of query params to set when navigating to this page

views Array.<View~ViewDefinition> <optional>

views belonging to this Page

components Array.<Component~ComponentDefinition> <optional>

components to add to this Page

Source: