Skip to content

Instantly share code, notes, and snippets.

@Cleanse
Created March 26, 2019 18:19
Show Gist options
  • Save Cleanse/6ecf2e48884cdc81a1a0a0ecf3aa1ef3 to your computer and use it in GitHub Desktop.
Save Cleanse/6ecf2e48884cdc81a1a0a0ecf3aa1ef3 to your computer and use it in GitHub Desktop.
//default.htm
<button type="button" class="btn btn-primary"
data-request="onGetExample"
data-request-data="id: 1" <!-- can be dynamic content {{ e.id }} -->
data-request-update="'{{ __SELF__ }}::modalPartial': '#result'"
data-toggle="modal"
data-target="#exampleModal">
Launch Team Modal
</button>
<div id="result">
{% partial '@modalPartial' %}
</div>
/**
* modalPartial.htm
*/
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" id="exampleResult" role="document">
{% partial '@example' %}
</div>
</div>
/**
* example.htm
*/
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="examplemModalLabel">{{ ex }}</h5>
<button type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<ul>
{% for e in ex.exampleArray %}
<li>{{ e.exampleAttribute }}</li>
{% endfor %}
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment