-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractComponent.ts
More file actions
43 lines (35 loc) · 940 Bytes
/
AbstractComponent.ts
File metadata and controls
43 lines (35 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
declare let $: any;
export abstract class AbstractComponent
{
public static selector: string = null;
protected componentElement: any;
protected componentParam: any;
protected DI = null;
protected constructor(componentElement: any, DI)
{
this.componentElement = componentElement;
this.componentElement.attr('protected-component', 'true');
this.DI = DI;
return this;
}
public init() {}
public getComponentClassName()
{
return this.constructor['name'];
}
public getComponentParameter()
{
this.componentParam = this
.componentElement
.attr(this.constructor['selector']);
return this.componentParam;
}
public getComponentElement()
{
return $(`[component-id="${this.getId()}"]`);
}
public getId(): string
{
return this.componentElement.attr('component-id');
}
}