> 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/decorators.md).

# @angular-ru/cdk/decorators

* `AttributeBoolean`

```typescript
import {AttributeBoolean} from '@angular-ru/cdk/decorators';
import {InputBoolean} from '@angular-ru/cdk/typings';

@Component({
  selector: 'child-component',
  template: '',
})
class ChildComponent {
  @AttributeBoolean() @Input() public prop1: InputBoolean; // === true
  @Input() public prop2: InputBoolean; // === '', while ('' == false)
  @AttributeBoolean() @Input() public prop3: InputBoolean; // === false
  @AttributeBoolean() @Input() public prop4: InputBoolean; // === true
  @AttributeBoolean() @Input() public prop5: InputBoolean; // === true
  @AttributeBoolean() @Input() public prop6: InputBoolean; // === false

  private _prop7: string;
  @AttributeBoolean()
  @Input()
  public set prop7(value: InputBoolean) {
    this._prop6 = `prop7: ${value}`;
  }

  public get prop7(): InputBoolean {
    // === 'prop7: true - from getter'
    return this._prop7 ? `${this._prop7} - from getter` : undefined;
  }

  // order doesn't matter in all cases
  public prop8Calls: boolean[] = []; // === [true]
  @AttributeBoolean()
  @Input()
  public set prop8(value: InputBoolean) {
    this.hookCalls.push(value as boolean);
  }

  @AttributeBoolean() @Input() public prop9: InputBoolean; // === false
}

@Component({
  selector: 'host-component',
  template: `
    <child-component
      [prop3]="falseString"
      [prop4]="someAnotherTruthy"
      [prop5]="emptyString"
      [prop6]="someAnotherFalsy"
      prop1
      prop2
      prop7
      prop8
      prop9="false"
    ></child-component>
  `,
})
class HostComponent {
  public falseString: string = 'false';
  public someAnotherTruthy: any = {};
  public emptyString: string = '';
  public someAnotherFalsy: any = null;
}
```

* `BoundClass`

```typescript
@Injectable()
class B {
  public b: string = '2';
}

@BoundClass
@Injectable()
class A {
  public a: string = '1';

  constructor(public readonly b: B) {}

  public getA() {
    return this;
  }
}

TestBed.configureTestingModule({providers: [A, B]});

const a = TestBed.inject(A);
const {getA} = a;

expect(a).toEqual({a: '1', b: {b: '2'}});
expect(getA()).toEqual({a: '1', b: {b: '2'}});
expect(getA() === a).toBeTruthy();
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
