Do not rely on global init order

This commit is contained in:
Michal Moskal committed 2017-07-11 12:31:34 +02:00
1 parent 0ef0fdf69a
commit a838421181
1 file changed
+3 -1
+3 -1
View File
@@ -1,9 +1,11 @@
namespace control {
let nextComponentId = 20000;
let nextComponentId: number;
export class Component {
protected _id: number;
constructor(id = 0) {
if (!nextComponentId)
nextComponentId = 20000
if (!id) id = ++nextComponentId
this._id = id
}