Skip to content

Commit 0c88de6

Browse files
authored
refactor(design): move host decorators to host property in image component (#3859)
1 parent 628546d commit 0c88de6

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

libs/design/image/src/image/image.component.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
EventEmitter,
66
OnInit,
77
Output,
8-
HostBinding,
98
} from '@angular/core';
109
import {
1110
DomSanitizer,
@@ -46,9 +45,11 @@ const validateProperties = (object: Record<string, any>, props: string[]) => {
4645
inputs: ['skeleton'],
4746
},
4847
],
48+
host: {
49+
'[style.max-width]': 'width + "px"',
50+
},
4951
})
5052
export class DaffImageComponent implements OnInit {
51-
5253
private _src: string;
5354

5455
/**
@@ -140,11 +141,4 @@ export class DaffImageComponent implements OnInit {
140141
get _aspectRatio(): SafeStyle {
141142
return this.sanitizer.bypassSecurityTrustStyle(this.width + ' / ' + this.height);
142143
}
143-
144-
/**
145-
* @docs-private
146-
*/
147-
@HostBinding('style.max-width') get maxWidth(): string {
148-
return this.width + 'px';
149-
}
150144
}

0 commit comments

Comments
 (0)