我从这个链接https://akveo.github.io/ng2-admin/articles/002-installation-guidelines/获得帮助。
我想将 jee 项目集成到这个模板中:我使用休息服务。
为了将新实体添加到我的数据库中,我必须将其添加到文件action.component.js 中:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { Grid } from '../../../lib/grid';
import { ActivatedRoute, RouterModule, Routes, Router } from '@angular/router';
import { Location } from '@angular/common';
import { Http, Headers, RequestOptions } from '@angular/http';
var ActionsComponent = (function () {
function ActionsComponent() {
this.create = new EventEmitter();
}
return ActionsComponent;
}());
__decorate([
Input(),
__metadata("design:type", Grid)
], ActionsComponent.prototype, "grid", void 0);
__decorate([
Output(),
__metadata("design:type", Object)
], ActionsComponent.prototype, "create", void 0);
ActionsComponent = __decorate([
Component({
selector: 'ng2-st-actions',
template: "\n <a href=\"#\" [innerHTML]=\"grid.getSetting('add.createButtonContent')\"\n (click)=\"$event.preventDefault();create.emit($event)\"></a>\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-add-cancel\"\n [innerHTML]=\"grid.getSetting('add.cancelButtonContent')\"\n (click)=\"$event.preventDefault();grid.createFormShown = false;\"></a>\n ",
})
], ActionsComponent);
export { ActionsComponent };
//# sourceMappingURL=actions.component.js.map
知道用于添加实体的方法如上定义create.emit($event)
。
你有什么想法解决这个问题吗?非常感谢。