<mat-select class="mat-select-custom" formControlName="sourceData" (selectionChange)="sourceDataSwitch($event)" required>
<mat-option value="">{{ 'PleaseSelect' | translate }}</mat-option>
<mat-optgroup *ngFor="let item of sourceDataSurveyList" [label]="item['surveyName'][usingLanguage]">
<mat-option *ngFor="let question of item['questions']" [attr.data-optionsArray]="init(question['optionsArray'])" value="{{question['externalQuestionID']}}#{{question['questionTypeId']}}">
{{question['question'][usingLanguage]}}
</mat-option>
</mat-optgroup>
</mat-select>
sourceDataSwitch(event)
{
let target=event.source.selected._element.nativeElement.getAttribute('data-optionsArray');
}