UNPKG

574 BJavaScriptView Raw
1const ViewAction = require ('./view-action');
2const assert = require ('assert');
3
4/**
5 * @class SingleViewAction
6 *
7 * Specialization of the ViewAction class that only supports a single view. Subclasses,
8 * and instances of this class, must provide the template property.
9 */
10module.exports = ViewAction.extend ({
11 init () {
12 this._super.call (this, ...arguments);
13
14 assert (!!this.template, "You must define the 'template' property.");
15 },
16
17 /// Name of the view template to render for this action.
18 template: null,
19
20 view () {
21 return this.template;
22 }
23});