From abb78336f7783b5223d8398c00aac85e85ce15da Mon Sep 17 00:00:00 2001 From: Yossi Kolesnicov Date: Mon, 20 Nov 2017 10:43:44 +0200 Subject: [PATCH] Added error when no endpoint and no values defined. --- lib/entity/entity.config.ts | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/entity/entity.config.ts b/lib/entity/entity.config.ts index 93e1d26..885bca6 100644 --- a/lib/entity/entity.config.ts +++ b/lib/entity/entity.config.ts @@ -14,6 +14,8 @@ export class ModelEntity extends EntityConfigBase{ super(config, entityConstructor); this.loadAll = config.loadAll === true; + if (!this.endpoint && !this.values) + throw new Error(`Can't create entity ${this.entityConstructor.name}, no endpoint or values defined.`); } } diff --git a/package.json b/package.json index e72fc70..2df8b6f 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "systemjs": ">=0.20.12", "typescript": "^2.4.2", "zone.js": ">=0.8.7", - "run-sequence": "^2.2.0" + "run-sequence": "^2.2.0" }, "peerDependencies": { "rxjs": ">=5.2.0",