aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/admin/friends/friend-add/friend-add.component.html
blob: 788f3b44d168d5894aabc4316e9079fb898c13ca (plain) (tree)
1
2
3
4
5
6
7
8
9



                                                               
                                                    

                                                                                           
 
                             

                                                                        
                                                          
        

                                                                                                                 
                                                                                                                         

             
 
                                                                                                                        

                               

        
                                                                                                
       
<h3>Make friends</h3>

<div *ngIf="error" class="alert alert-danger">{{ error }}</div>

<form (ngSubmit)="makeFriends()" [formGroup]="form">
  <div class="form-group"  *ngFor="let url of urls; let id = index; trackBy:customTrackBy">
    <label for="username">Url</label>

    <div class="input-group">
      <input
        type="text" class="form-control" placeholder="http://domain.com"
        [id]="'url-' + id" [formControlName]="'url-' + id"
      />
      <span class="input-group-btn">
        <button *ngIf="displayAddField(id)" (click)="addField()" class="btn btn-default" type="button">+</button>
        <button *ngIf="displayRemoveField(id)" (click)="removeField(id)" class="btn btn-default" type="button">-</button>
      </span>
    </div>

    <div [hidden]="form.controls['url-' + id].valid || form.controls['url-' + id].pristine" class="alert alert-warning">
      It should be a valid url.
    </div>
  </div>

  <input type="submit" value="Make friends" class="btn btn-default" [disabled]="!isFormValid()">
</form>