From 605a173d252b21ad695f2b720de640b624bc600c Mon Sep 17 00:00:00 2001 From: Elad Bezalel Date: Fri, 27 Nov 2015 18:48:03 +0200 Subject: [PATCH] docs(dialog): added docs to the elements and fixed controller 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 --- src/components/dialog/dialog.js | 37 +++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/components/dialog/dialog.js b/src/components/dialog/dialog.js index 8ebc0da9b46..62dff8cdfa0 100644 --- a/src/components/dialog/dialog.js +++ b/src/components/dialog/dialog.js @@ -10,6 +10,39 @@ angular .directive('mdDialog', MdDialogDirective) .provider('$mdDialog', MdDialogProvider); +/** + * @ngdoc directive + * @name mdDialog + * @module material.components.dialog + * + * @restrict E + * + * @description + * `` - The dialog's template must be inside this element. + * + * Inside, use an `` element for the dialog's content, and use + * an `` 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 + * + * + * + * + * + *

Number {{item}}

+ *
+ *
+ *
+ * + * Close Dialog + * + *
+ *
+ */ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) { return { restrict: 'E', @@ -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 @@ -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