<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" id="createTag" role="dialog" aria-labelledby="createOrEditModal" aria-hidden="true" >
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>{{"TagTypeCreate" | localize}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')" [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
    
                    <div class="form-group">
                        <label for="Name">{{"Name" | localize}} *</label>
                        <input id="Name" #name="ngModel" type="text" name="Name" class="form-control" [(ngModel)]="tag.name" required/>
                        <validation-messages [formCtrl]="name"></validation-messages>
                    </div>

                    <label for="TagType">{{"TagType" | localize}} *</label>
                    <div class="form-group">
                        <select class="form-control kt-select2" id="selectPreview" [(ngModel)]="tag.tagTypeId" name="selectPreview"  #tagtype="ngModel" >
                            <option *ngFor="let tagType of filteredTagType"  [(value)]="tagType.id">
                                {{tagType.name}}
                            </option>
                        </select>
                        <validation-messages [formCtrl]="tagtype"></validation-messages>
                    </div>

                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default btn-elevate btn-pill" (click)="close()">{{"Cancel" | localize}}</button>
                    <button type="submit" class="btn btn-primary btn-elevate btn-pill" [disabled]="!userForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i> <span>{{"Save" | localize}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>
