Do not rely on global init order

This commit is contained in:
Michal Moskal 2017-07-11 12:31:34 +02:00
parent 0ef0fdf69a
commit a838421181

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
}