### File

`src/lib/mat-input-has-enable-permission.directive.ts`

### Extends

`HasEnablePermission`

### Metadata

Selector | `[matInput][rxapHasEnablePermission]:not([formControl]):not([formControlName])`
Standalone | `true`

### Index

###### Properties

- Public identifier

###### Methods

- Public setDisabled

###### Inputs

- rxapHasEnablePermission

### Constructor

`constructor(authorization: AuthorizationService, cdr: ChangeDetectorRef, matInput: MatInput, scope: string, valueAccessor: ControlValueAccessor[] | null)`
Defined in src/lib/mat-input-has-enable-permission.directive.ts:25

Parameters :

Name | Type | Optional
authorization | `AuthorizationService` | No
cdr | `ChangeDetectorRef` | No
matInput | `MatInput` | No
scope | `string` | No
valueAccessor | `ControlValueAccessor[] | null` | No

### Inputs

rxapHasEnablePermission
Type : `string`
Defined in src/lib/mat-input-has-enable-permission.directive.ts:25

### Methods

Public setDisabled
`setDisabled(disabled: boolean)`
Inherited from `HasEnablePermission`
Defined in `HasEnablePermission:44`

Parameters :

Name | Type | Optional
disabled | `boolean` | No

Returns : `void`

### Properties

Public identifier
Type : `string`
Inherited from `HasEnablePermission`
Defined in `HasEnablePermission:20`

    import {
      ChangeDetectorRef,
      Directive,
      Inject,
      Input,
      Optional,
    } from '@angular/core';
    import {
      ControlValueAccessor,
      NG_VALUE_ACCESSOR,
    } from '@angular/forms';
    import { MatInput } from '@angular/material/input';
    import { AuthorizationService } from './authorization.service';
    import { HasEnablePermission } from './has-enable-permission';
    import { RXAP_AUTHORIZATION_SCOPE } from './tokens';

    @Directive({
      selector: '[matInput][rxapHasEnablePermission]:not([formControl]):not([formControlName])',
      standalone: true,
    })
    export class MatInputHasEnablePermissionDirective extends HasEnablePermission {

      // eslint-disable-next-line @angular-eslint/no-input-rename
      @Input('rxapHasEnablePermission')
      public override identifier!: string;

      constructor(
        @Inject(AuthorizationService)
          authorization: AuthorizationService,
        @Inject(ChangeDetectorRef)
          cdr: ChangeDetectorRef,
        @Inject(MatInput)
        private readonly matInput: MatInput,
        @Optional()
        @Inject(RXAP_AUTHORIZATION_SCOPE)
          scope: string,
        @Optional()
        @Inject(NG_VALUE_ACCESSOR)
          valueAccessor: ControlValueAccessor[] | null = null,
      ) {
        super(authorization, cdr, scope, valueAccessor);
      }

      public setDisabled(disabled: boolean) {
        this.matInput.disabled = disabled;
      }
    }

# results matching ""

# No results matching ""