> For the complete documentation index, see [llms.txt](https://angular-ru.gitbook.io/sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://angular-ru.gitbook.io/sdk/cdk/directives.md).

# @angular-ru/cdk/directives

* `InitialFocus`
* Selector: `initialFocus`
* API:
  * `Input() focusDisabled: boolean` - default: `false`

```typescript
import {InitialFocus} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  //...
  imports: [InitialFocus],
  template: `
    <input
      [focusDisabled]="false"
      initialFocus
      placeholder="hello world"
    />
  `,
})
export class AppComponent {}
```

* `AmountFormat`

```typescript
import {AmountFormat} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  //...
  imports: [AmountFormat],
  template: `
    <input
      amountFormat
      value="10000000"
    />
  `, // 1 000 000
})
export class AppComponent {}
```

* `ConvertCase`

```typescript
import {ConvertCase} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  //...
  imports: [ConvertCase],
  template: `
    <input
      convertCase
      placeholder="ru"
    />
  `, // RU
})
export class AppComponent {}
```

* `DisableControl`

```typescript
import {DisableControl} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  //...
  imports: [DisableControl],
  template: `
    <input
      disableControl
      formControlName="name"
    />
  `, // disabled = true
})
export class AppComponent {}
```

* `MaxLength`

```typescript
import {MaxLength} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  //...
  imports: [MaxLength],
  template: `
    <input
      maxLength="3000"
      placeholder="3001"
    />
  `, // empty value
})
export class AppComponent {}
```

* `TrimInput`
* Selector: `trimInput`

API:

* `@Input('trimDisabled') disabled: boolean` - default: `false`

```typescript
import {TrimInput} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  //...
  imports: [TrimInput],
  template: `
    <input
      [trimDisabled]="false"
      trimInput
      placeholder="  Hello  "
    />
  `, // 'Hello'
})
export class AppComponent {}
```

* `SplitString`

```typescript
import {SplitString, SplitStringOptions} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  selector: 'test',
  imports: [SplitString],
  template: `
        <form [formGroup]="form">
            <input type="text" formControlName="input1" splitString" />
            <input
                type="text"
                formControlName="input2"
                splitString
                [splitOptions]="splitStringOptions"
            />
        </form>
    `,
})
class TestComponent {
  public splitStringOptions?: Partial<SplitStringOptions> = {separator: /[,;\n+]/g, joinWith: ' + '};
  public form = this.fb.group({
    input1: ['one', 'two'],
    input2: ['three', 'four'],
  });
  /**
   * Native input1 value will be joined by default by comma ('one, two')
   * and will be automatically splitted
   * by default separator while user is typing.
   * Default separator is /[,;\n]/g (comma, semicolon, line break)
   *
   * Native input2 value will be joined with ' + ' ('three + four')
   * and will be splitted by specified separator /[,;\n+]/g
   */

  constructor(private readonly fb: FormBuilder) {}
}
```

* `InputFilter`

```typescript
import {InputFilter, FilterPredicate} from '@angular-ru/cdk/directives';
import {Component} from '@angular/core';

@Component({
  //...
  imports: [InputFilter],
  template: `
    <div [formGroup]="form">
      <input
        [filterDisabled]="false"
        [inputFilter]="predicate"
        matInput
        type="text"
        formControlName="value"
      />
    </div>
  `,
})
export class AppComponent {
  public predicate: FilterPredicate;

  constructor() {
    this.predicate = ['a', 'b', 'c'];
    this.predicate = /[a,b]+/;
    this.predicate = (item: string): boolean => item === 'a' || item === 'b';
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://angular-ru.gitbook.io/sdk/cdk/directives.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
