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

Commit ff34149

Browse files
committed
docs(dialog): remove invalid, outdated example code
- minor refinements to $mdDialog example formatting Closes #10562
1 parent d77fbc4 commit ff34149

File tree

1 file changed

+23
-31
lines changed

1 file changed

+23
-31
lines changed

src/components/dialog/dialog.js

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) {
281281
* </hljs>
282282
*
283283
* ### JavaScript: promise API syntax, custom dialog template
284+
*
284285
* <hljs lang="js">
285-
* (function(angular, undefined){
286+
* (function(angular, undefined) {
286287
* "use strict";
287288
*
288289
* angular
@@ -297,7 +298,6 @@ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) {
297298
* var ctrl = this;
298299
*
299300
* ctrl.showAlert = showAlert;
300-
* ctrl.closeAlert = closeAlert;
301301
* ctrl.showGreeting = showCustomGreeting;
302302
*
303303
* ctrl.hasAlert = function() { return !!alert };
@@ -312,44 +312,36 @@ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) {
312312
* .ok('Close');
313313
*
314314
* $mdDialog
315-
* .show( alert )
315+
* .show(alert)
316316
* .finally(function() {
317317
* alert = undefined;
318318
* });
319319
* }
320320
*
321-
* // Close the specified dialog instance and resolve with 'finished' flag
322-
* // Normally this is not needed, just use '$mdDialog.hide()' to close
323-
* // the most recent dialog popup.
324-
* function closeAlert() {
325-
* $mdDialog.hide( alert, "finished" );
326-
* alert = undefined;
327-
* }
328-
*
329321
* // Dialog #2 - Demonstrate more complex dialogs construction and popup.
330322
*
331323
* function showCustomGreeting($event) {
332-
* $mdDialog.show({
333-
* targetEvent: $event,
334-
* template:
335-
* '<md-dialog>' +
336-
* ' <md-dialog-content>Hello {{ ctrl.employee }}!</md-dialog-content>' +
337-
* ' <md-dialog-actions>' +
338-
* ' <md-button ng-click="ctrl.closeDialog()" class="md-primary">' +
339-
* ' Close Greeting' +
340-
* ' </md-button>' +
341-
* ' </md-dialog-actions>' +
342-
* '</md-dialog>',
343-
* controller: GreetingController,
344-
* controllerAs: 'ctrl',
345-
* onComplete: afterShowAnimation,
346-
* locals: { employee: ctrl.userName }
347-
* });
324+
* $mdDialog.show({
325+
* targetEvent: $event,
326+
* template:
327+
* '<md-dialog>' +
328+
* ' <md-dialog-content>Hello {{ ctrl.employee }}!</md-dialog-content>' +
329+
* ' <md-dialog-actions>' +
330+
* ' <md-button ng-click="ctrl.closeDialog()" class="md-primary">' +
331+
* ' Close Greeting' +
332+
* ' </md-button>' +
333+
* ' </md-dialog-actions>' +
334+
* '</md-dialog>',
335+
* controller: GreetingController,
336+
* controllerAs: 'ctrl',
337+
* onComplete: afterShowAnimation,
338+
* locals: { employee: ctrl.userName }
339+
* });
348340
*
349-
* // When the 'enter' animation finishes...
350-
* function afterShowAnimation(scope, element, options) {
351-
* // post-show code here: DOM element focus, etc.
352-
* }
341+
* // When the 'enter' animation finishes...
342+
* function afterShowAnimation(scope, element, options) {
343+
* // post-show code here: DOM element focus, etc.
344+
* }
353345
* }
354346
* }
355347
*

0 commit comments

Comments
 (0)