Skip to content

Commit fa4bb8f

Browse files
committed
fix: color directive color prefix
1 parent 8646426 commit fa4bb8f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

library/angular-admin-lte/src/lib/color/color.directive.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import { ColorService } from './color.service';
77
providers: [ColorService]
88
})
99
export class BackgroundColorDirective {
10+
11+
private _prefix: string;
12+
private _color: string;
13+
1014
/**
1115
* @method constructor
1216
* @param elementRef [description]
@@ -20,10 +24,14 @@ export class BackgroundColorDirective {
2024
) {}
2125

2226
@Input('mkColorCondition') condition = true;
23-
@Input('mkColorPrefix') prefix: string;
27+
@Input('mkColorPrefix') set prefix(prefix: string) {
28+
this._prefix = prefix;
29+
this.colorService.setBackgroundColor(this._color, this.condition, this.property, this._prefix);
30+
}
2431
@Input('mkColorProperty') property: string;
2532
@Input('mkColor') set color(color: string) {
26-
this.colorService.setBackgroundColor(color, this.condition, this.property, this.prefix);
33+
this._color = color;
34+
this.colorService.setBackgroundColor(this._color, this.condition, this.property, this._prefix);
2735
}
2836
}
2937

0 commit comments

Comments
 (0)