title: Angular 5 select and unselect a checkbox
body: <p>Alright I have a terms of service modal which is an ngBootstrap modal and when I press the button to close that button I want the action that closes the modal define wheter the checkbox is checked or not
  This is the html:</p>
  
  <pre><code>  &lt;ng-template #content let-c="close" let-d="dismiss"&gt;
    &lt;div class="modal-header"&gt;
    &lt;h4 class="modal-title"&gt;Terms of service.&lt;/h4&gt;
    &lt;button type="button" class="close" aria-label="Close" (click)="d('Cross 
    click')"&gt;
    &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
    &lt;/button&gt;
    &lt;/div&gt;
    &lt;button type="button" class="btn btn-success" (click)="c('Close click'); 
     setAccepted(true)" &gt;I accept.&lt;/button&gt;
    &lt;/ng-template&gt;
  </code></pre>
  
  <p>the link to open the modal and the checkbox</p>
  
  <pre><code>&lt;div class="custom-control custom-checkbox"&gt;
              &lt;input *ngIf="accepted" type="checkbox" class="custom-
  control-input" id="save-info" required&gt;
              &lt;label class="custom-control-label" for="save-info"&gt;I have read 
  &lt;/label&gt;&lt;a href="javascript:void(0)" (click)="open(content)"&gt; 
    the terms of service&lt;/a&gt;.
  &lt;/div&gt;
  </code></pre>
  
  <p>And under it I have  <code>&lt;p&gt;{{accepted}}&lt;/p&gt;</code> just for testing</p>
  
  <p>And the typescript</p>
  
  <pre><code>accepted: boolean = false;
  
  constructor(private modalService: NgbModal) {}
  
  open(content) {
   this.modalService.open(content);
  }
  
  setAccepted(accepted:boolean){
    this.accepted = accepted;
  }
  </code></pre>
  
  <p>I tried [(ngModel)], *ngIf, ngModel to the accepted boolean from my typescript but nothing seems to work.</p>