Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
docs(dialog): added docs to the elements and fixed controller
Browse files Browse the repository at this point in the history
Added `md-dialog` directive page that contains - `md-dialog`, `md-dialog-content`, `md-dialog-actions`.
Added `function` type to controller method

fixes #4728 and #3199

Closes #5957
  • Loading branch information
EladBezalel authored and ThomasBurleson committed Dec 2, 2015
1 parent ff11fb4 commit 605a173
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,39 @@ angular
.directive('mdDialog', MdDialogDirective)
.provider('$mdDialog', MdDialogProvider);

/**
* @ngdoc directive
* @name mdDialog
* @module material.components.dialog
*
* @restrict E
*
* @description
* `<md-dialog>` - The dialog's template must be inside this element.
*
* Inside, use an `<md-dialog-content>` element for the dialog's content, and use
* an `<md-dialog-actions>` element for the dialog's actions.
*
* * ## CSS
* - `.md-dialog-content` - class that sets the padding on the content as the spec file
*
* @usage
* ### Dialog template
* <hljs lang="html">
* <md-dialog aria-label="List dialog">
* <md-dialog-content>
* <md-list>
* <md-list-item ng-repeat="item in items">
* <p>Number {{item}}</p>
* </md-list-item>
* </md-list>
* </md-dialog-content>
* <md-dialog-actions>
* <md-button ng-click="closeDialog()" class="md-primary">Close Dialog</md-button>
* </md-dialog-actions>
* </md-dialog>
* </hljs>
*/
function MdDialogDirective($$rAF, $mdTheming, $mdDialog) {
return {
restrict: 'E',
Expand Down Expand Up @@ -66,7 +99,7 @@ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) {
* - Complex dialogs can be sized with `flex="percentage"`, i.e. `flex="66"`.
* - Default max-width is 80% of the `rootElement` or `parent`.
*
* ## Css
* ## CSS
* - `.md-dialog-content` - class that sets the padding on the content as the spec file
*
* @usage
Expand Down Expand Up @@ -372,7 +405,7 @@ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) {
* - `focusOnOpen` - `{boolean=}`: An option to override focus behavior on open. Only disable if
* focusing some other way, as focus management is required for dialogs to be accessible.
* Defaults to true.
* - `controller` - `{string=}`: The controller to associate with the dialog. The controller
* - `controller` - `{function|string=}`: The controller to associate with the dialog. The controller
* will be injected with the local `$mdDialog`, which passes along a scope for the dialog.
* - `locals` - `{object=}`: An object containing key/value pairs. The keys will be used as names
* of values to inject into the controller. For example, `locals: {three: 3}` would inject
Expand Down

0 comments on commit 605a173

Please sign in to comment.