Skip to content

Commit

Permalink
Added example of setting global defaults for all dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
robbaman authored and voronianski committed Aug 10, 2014
1 parent c1469f7 commit 71fcf76
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ <h3>ngDialog modal example</h3>
<script>
var app = angular.module('exampleDialog', ['ngDialog']);

// Example of how to set default values for all dialogs
app.config(['ngDialogProvider', function (ngDialogProvider) {
ngDialogProvider.setDefaults({
className: 'ngdialog-theme-default',
plain: false,
showClose: true,
closeByDocument: true,
closeByEscape: true,
appendTo: false
});
}]);

app.controller('MainCtrl', function ($scope, $rootScope, ngDialog) {
$rootScope.jsonData = '{"foo": "bar"}';
$rootScope.theme = 'ngdialog-theme-default';
Expand Down

0 comments on commit 71fcf76

Please sign in to comment.