pentcloud-angular-mdl-dialog
v1.2.2
Published
Angular directive for HTML's new native Dialog tag. Also supports MDL dialogs.
Downloads
3
Readme
pentcloud-angular-mdl-dialog
Angular directive for HTML's new native Dialog tag. Also supports MDL dialogs.
Angular wrapper for HTML5 dialogs.
Usage :
- If you use npm, set your npm registry to npm.pentcloud.com (
npm set registry http://npm.pentcloud.com
) and then runnpm install pentcloud-angular-mdl-dialog
. - If not, download files from the github repo.
<script src="angular.min.js"></script>
<script src="pentcloud-angular-mdl-dialog-min.js"></script>
- Add the
pentcloud-angular-mdl-dialog
module as a dependency to your application module:
angular.module('MyApp', ['pentcloud-angular-mdl-dialog']);
- Add a
ng-mdl-dialog
attribute to any element with the name of a $scope variable that will be created to contain you dialog instance.
<dialog class="mdl-dialog" ng-mdl-dialog="createDialog">
<!-- Your content goes here -->
</dialog>
- Use the show() or showModal() method to show the dialog.
$scope.createDialog.showModal();
- Use the close() method to close the dialog.
$scope.createDialog.close();
Official methods and events documentation here