text color in kendo-numerictextbox in KendoUI for Angular

898 Views Asked by At

I want to change the text color in a kendo-numerictextbox for KendoUI for Angular.

The style attribute has no effect. With Jquery we can change the style but how can we do this in KendoUI for Angular ?

<kendo-numerictextbox class="form-control"
               [decimals]="1"
                       [spinners]="false"
                       [format]="'n1'"
                       tabindex="{{i}}" 
                       style="font-size:12px; padding:1px; color:red"
                       [formControlName]="item.Index" >
  </kendo-numerictextbox>

1

There are 1 best solutions below

2
Pooja On

import { Component } from "@angular/core";

@Component({
  selector: "my-app",
  template: `
    <style>
      ::ng-deep .k-numerictextbox .k-numeric-wrap .k-input {
        color: red;
      }
    </style>
    <kendo-numerictextbox
      [value]="value"
      [min]="0"
      [max]="100"
      [autoCorrect]="autoCorrect"
      style="font-size:12px; padding:1px;"
    >
    </kendo-numerictextbox>
  `
})
export class AppComponent {
  public autoCorrect: boolean = false;
  public value: number = 5;
}