SearchKit/Afform - Provide contextual titles to search Afforms in standalone mode
[civicrm-core.git] / ang / crmDialog.md
CommitLineData
24588be5
TO
1The `crmDialog` is a helper for working with the `dialogService`. In particular, it allows you to define then
2dialog widgets as part of the markup.
3
4To open a dialog:
5
6```js
7dialogService.open('someDialog', '~/Path/To/Some.html', model, options)
8 .then(function(result){
9 console.log('received output from dialog', result);
10 });
11```
12
13```html
14<!-- FILE: Path/To/Some.html -->
15<div id="bootstrap-theme" crm-dialog="someDialog">
16 <form name="someForm">
17
18 <input type="text" ng-model="model.foo"/>
19
20 <crm-dialog-button text="ts('Create')" icons="{primary: 'fa-plus'}" on-click="someDialog.close(model)" disabled="!someForm.$valid" />
21 <crm-dialog-button text="ts('Cancel')" icons="{primary: 'fa-times'}" on-click="someDialog.cancel()" />
22 </form>
23</div>
24```