angular/aio/content/examples/attribute-binding/src/app/comp-with-host-binding.component.ts
2020-02-06 09:33:28 -08:00

17 lines
345 B
TypeScript

import { Component } from '@angular/core';
@Component({
selector: 'comp-with-host-binding',
template: 'I am a component!',
host: {
'[class.special]': 'isSpecial',
'[style.color]': 'color',
'[style.width]': 'width'
}
})
export class CompWithHostBindingComponent {
isSpecial = false;
color = 'green';
width = '200px';
}