Merge pull request #24140 from eileenmcnaughton/invoice_test
[civicrm-core.git] / ang / crmDialog.md
1 The `crmDialog` is a helper for working with the `dialogService`. In particular, it allows you to define then
2 dialog widgets as part of the markup.
3
4 To open a dialog:
5
6 ```js
7 dialogService.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 ```