# loadDepenentSelectOnChange

### **Description**

This property is helps to load the dependent select field on the change of the field.

### Hint:

> * Type:   Object
> * Property of NgMatFormField

### Example

```typescript
Fields: NgMatFormFields[] = [{
    type: 'select',
    label: 'Animal',
    placeholder: 'Select Animal',
    formControlName: 'animal',
    list: [],
    getListFromApi: true,
    api: {
        header: new HttpHeaders().set('Access-Control-Allow-Origin', '*'),
        url: 'https://my-json-server.typicode.com/msk-satheesh-5599/Portfolio/db',
        method: 'get',
        params: {}
    },
    validators: [Validators.required],
    errorMessage: {
        required: 'required!'
    },
    loadDepenentSelectOnChange: {
        //formControl name of the depenent select field
        formControlName: 'dependent',
        //api service
        api: {
            header: new HttpHeaders().set('Access-Control-Allow-Origin', '*'),
            url: `https://my-json-server.typicode.com/msk-satheesh-5599/Portfolio/data`,
            method: 'get',
            params: { value: 'msk' }
        },
    }
}, {
    type: 'select',
    label: 'Food of animal',
    placeholder: 'Select Food',
    formControlName: 'dependent',
    list: [],
    validators: [Validators.required]
}];
```

