Commit e2b87245 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Les UID des objets JaLhyd sont maintenant des chaînes aléatoires

Showing with 5 additions and 13 deletions
+5 -13
......@@ -9,23 +9,15 @@ export interface INamedObject extends IJalhydObject {
export abstract class JalhydObject implements IJalhydObject {
public get uid(): string {
return String(this._uid);
return this._uid;
}
public static get nextUID(): number {
const res = this._uidSequence;
this._uidSequence++;
return res;
public static get nextUID(): string {
return Math.random().toString(36).substring(2, 8);
}
/**
* générateur d'id
*/
private static _uidSequence: number = 0;
/**
* id numérique unique
*/
private _uid: number;
/** id numérique unique */
private _uid: string;
constructor() {
this._uid = JalhydObject.nextUID;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment