src/input/input.directive.ts
A directive for applying styling to an input element.
Example:
<input ibmText/>See the vanilla carbon docs for more detail.
| selector | [ibmText] |
Inputs |
HostBindings |
theme
|
Type:
Default value: |
|
Defined in src/input/input.directive.ts:21
|
|
| class.bx--text-input |
class.bx--text-input:
|
Default value : true
|
|
Defined in src/input/input.directive.ts:23
|
| class.bx--text-input--light |
class.bx--text-input--light:
|
|
Defined in src/input/input.directive.ts:24
|
import { Directive, HostBinding, Input } from "@angular/core";
/**
* A directive for applying styling to an input element.
*
* Example:
*
* ```html
* <input ibmText/>
* ```
*
* See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/text-input/code) for more detail.
*/
@Directive({
selector: "[ibmText]"
})
export class TextInput {
/**
* `light` or `dark` input theme
*/
@Input() theme: "light" | "dark" = "dark";
@HostBinding("class.bx--text-input") inputClass = true;
@HostBinding("class.bx--text-input--light") get isLightTheme() {
return this.theme === "light";
}
}