Namespace: $scope

Angular.MasterController# $scope

The MasterController's $scope object. All properties on $scope are available to the view.

Source:

Members

alerts :Array.<string>

Array for holding alert messages.

Type:
  • Array.<string>
Source:

blackoutClass :boolean

A flag indicating whether or not the 'blackout' class should be added to the body of the visible page. When this is true, the page is blacked out.

Type:
  • boolean
Source:

debugMode :boolean

Indicates whether or not debugging mode is enabled.

Type:
  • boolean
Source:

Methods

addAlert(alert) → {undefined}

Adds an alert to $scope#alerts, unless it is already present.

Parameters:
Name Type Description
alert Object

This object should have two properties: msg and type. The value of the msg property should be the alert string, and the value of the type property should be a string indicating the alert type. Acceptable values for alert types are: 'success', 'info', 'warning', and 'danger'.

Source:
Returns:
Type
undefined

addGenericErrorAlert() → {undefined}

Adds a generic error alert to $scope#alerts. The alert is a 'danger'-type alert, and in the demo app displays the message 'There seems to be a problem. Please contact a mediator for assistance.'

Source:
Returns:
Type
undefined

advanceSlide() → {undefined}

Resets the inactivity timeout, advance the slide by calling ExperimentManager#advanceSlide., and clear all current alerts.

Source:
Returns:
Type
undefined

closeAlert(index) → {undefined}

Closes the alert in $scope#alerts at the specified index.

Parameters:
Name Type Description
index number

The index in the $scope#alerts array of the alert to close

Source:
Returns:
Type
undefined

handleRightArrow() → {undefined}

Calls ExperimentManager#advanceSlide if Angular.ExperimentManager#$scope#debugMode is true.

Source:
Returns:
Type
undefined

hideBody() → {undefined}

A convenience method for setting $scope#blackoutClass to true (and blacking out the page).

Source:
Returns:
Type
undefined

setLanguage(language) → {undefined}

Set the current language used for displaying content. Ensure that you have translations available and compiled (see the README).

Parameters:
Name Type Description
language string

The language code of the language to use

Source:
Returns:
Type
undefined

showBody() → {undefined}

A convenience method for setting $scope#blackoutClass to false (and reversing the blacking out of the page).

Source:
Returns:
Type
undefined

startOver() → {undefined}

Return to the 'home' state.

Source:
Returns:
Type
undefined

toggleBodyVisibility() → {undefined}

A convenience method for toggling the value of $scope#blackoutClass.

Source:
Returns:
Type
undefined

toggleDebugMode() → {undefined}

Toggles debugging mode. If debugging mode is enabled, an alert is posted to the view.

Source:
Returns:
Type
undefined

trialDataJson() → {Object}

Expose TrialData#toJson on $scope. Calling this method returns the result of calling TrialData#toJson.

Source:
Returns:
Type
Object