nakedobjects.spa
Version:
Single Page Application client for a Naked Objects application.
31 lines • 1.44 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { MessageViewModel } from './message-view-model';
import * as Helpers from './helpers-view-models';
import map from 'lodash/map';
var MenuViewModel = (function (_super) {
__extends(MenuViewModel, _super);
function MenuViewModel(viewModelFactory, menuRep, routeData) {
var _this = _super.call(this) || this;
_this.viewModelFactory = viewModelFactory;
_this.menuRep = menuRep;
_this.routeData = routeData;
_this.id = menuRep.menuId();
var actions = menuRep.actionMembers();
_this.title = menuRep.title();
_this.actions = map(actions, function (action) { return viewModelFactory.actionViewModel(action, _this, routeData); });
_this.menuItems = Helpers.createMenuItems(_this.actions);
return _this;
}
return MenuViewModel;
}(MessageViewModel));
export { MenuViewModel };
//# sourceMappingURL=menu-view-model.js.map