TechQA.

What does the "let-modal" tag do?

1k views Asked by Menelaus At 2022-07-24T14:49:11+00:00 24 July 2022 at 14:49 2025-12-24T13:45:46+00:00

So, I've been using a basic ng-bootstrap modal for an Angular app.

<ng-template #content let-modal>
    <div class="modal-header">
      <h4 class="modal-title" id="modal-basic-title"></h4>
      <button type="button" class="btn-close" aria-label="Close" (click)="modal.dismiss('Cross click')"></button>
    </div>
    
    <div class="modal-body">
      <form>
        <div class="mb-3">
          <label for="dateOfBirth">Date of birth</label>
        </div>
      </form>
    </div>

    <div class="modal-footer">
      <button type="button" class="btn btn-outline-dark" (click)="modal.close('Save click')">Save</button>
    </div>
  </ng-template>
  
  <button class="btn btn-lg btn-outline-primary" (click)="open(content)">Launch demo modal</button>
  
  <hr> 

To work, it needs the let-x tag, which then that x it used to control functions like dismiss and close. Why is that? Why can't an instance of Ngb-Modal handle these things? And most importantly, how does this all work?

ng-bootstrap ng-bootstrap-modal
Original Q&A
0

There are 0 answers

Related Questions in NG-BOOTSTRAP

  • Tooltip buttons not working as expected/ Tooltip Closing when button is clicked
  • NgbModal from ng-bootstrap freezing and not working in ng-bootstrap version 15 and Angular version 16
  • Angular 17 - RangeError: Maximum call stack size exceeded on getComputedStyle
  • Customizing ngb-typeahead button (dropdown-item) in anglular
  • Angular 17 and ng-bootstrap,ngb-pagination problem
  • How to implement responsive offcanvas with ng-bootstrap
  • How can I write a custom type declaration for NgbModal that correctly infers the type of modalInstance?
  • ngbTooltip - Cancel tooltip appearance during delay
  • TypeError: Cannot read properties of null (reading '$implicit') with async pipe
  • ngb datepicker hover issue
  • Angular 17.0.6 issue with ng-bootstrap 16 heeeeeelp
  • cannot access accordion properties in component .ts file in angular using ng-bootstrap angular 17
  • How to Reshow ngbAlert (Bootstrap widgest for Angular) message again after dismissing it
  • Angular 17.0.9 issue with ng-bootstrap 16
  • ng-bootstrap scrollspy doesn't work without height?

Related Questions in NG-BOOTSTRAP-MODAL

  • NgbModal from ng-bootstrap freezing and not working in ng-bootstrap version 15 and Angular version 16
  • Upgrading angular from v15 to v16
  • forms input are not set in ng bootstrap modal
  • custom adapter ng bootstrap
  • How to remove the shadow of the draggable item in Angular
  • Error in JitCompiler when using ng-bootstrap with angular 13
  • Test the callback function in a NgbModal closed Observable with Jasmine
  • Should I manually call unsubscribe() on NgbModal @Output() EventEmitter subscription?
  • Carousel slide-ngb-slide-1 is not showing properly in ng-bootstrap
  • Modal not opened properly programmatically in angular
  • ng-bootstrap modal uses default change detection -- is there away to enforce on push?
  • Navigation links stop working after using ng-bootstrap modal to show a component
  • What does the "let-modal" tag do?
  • How to do I pass unique identifier from button to Modal in Handlebars?
  • Angular NgBootstrap Modal How to listen to backdrop click

Popular Questions

  • How do I undo the most recent local commits in Git?
  • How can I remove a specific item from an array in JavaScript?
  • How do I delete a Git branch locally and remotely?
  • Find all files containing a specific text (string) on Linux?
  • How do I revert a Git repository to a previous commit?
  • How do I create an HTML button that acts like a link?
  • How do I check out a remote Git branch?
  • How do I force "git pull" to overwrite local files?
  • How do I list all files of a directory?
  • How to check whether a string contains a substring in JavaScript?
  • How do I redirect to another webpage?
  • How can I iterate over rows in a Pandas DataFrame?
  • How do I convert a String to an int in Java?
  • Does Python have a string 'contains' substring method?
  • How do I check if a string contains a specific word?

Popular Tags

javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json

Trending Questions

  • UIImageView Frame Doesn't Reflect Constraints
  • Is it possible to use adb commands to click on a view by finding its ID?
  • How to create a new web character symbol recognizable by html/javascript?
  • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
  • Heap Gives Page Fault
  • Connect ffmpeg to Visual Studio 2008
  • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
  • How to avoid default initialization of objects in std::vector?
  • second argument of the command line arguments in a format other than char** argv or char* argv[]
  • How to improve efficiency of algorithm which generates next lexicographic permutation?
  • Navigating to the another actvity app getting crash in android
  • How to read the particular message format in android and store in sqlite database?
  • Resetting inventory status after order is cancelled
  • Efficiently compute powers of X in SSE/AVX
  • Insert into an external database using ajax and php : POST 500 (Internal Server Error)
  • Privacy
  • Terms
  • Cookies
  • Homegardensmart
  • Math
  • Aftereffectstemplates