# ngdialog

> ##### angular dialog only takes care of show & hide

Latest version **0.0.3** (published 2015-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngdialog
pnpm add ngdialog
yarn add ngdialog
bun add ngdialog
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-12-16 |
| First published | 2015-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | klamtine |
| Maintainers | klam |

## Links

- npm: https://www.npmjs.com/package/ngdialog
- Repository: https://github.com/klamtlne/ng-dialog
- Homepage: https://github.com/klamtlne/ng-dialog#readme
- Issues: https://github.com/klamtlne/ng-dialog/issues
- npm.io page: https://npm.io/package/ngdialog

## Recent versions

- 0.0.3 (latest) — 2015-12-16
- 0.0.2 — 2015-12-15
- 0.0.1 — 2015-12-15

## README

## ngdialog

##### angular dialog only takes care of show & hide

### Usage

```javascript
angular.module('app', ['ng-ui'])
  .controller('rootCtrl', ['ngDialog', fucntion(ngDialog) {
    ngDialog.show({
      templateUrl: '/data/html/modal.html',
      controller: function() {
        this.title = 'hello';
        this.content = 'world';

        this.onConfirm = function() {
          // do something
        };

        this.onCancel = function() {
          // do something else
        };
      },
      controllerAs: 'modal'
    });
  }]);
```

```html
<section>
  <header ng-bind="modal.title"></header>
  <div ng-bind="modal.content"></div>
  <footer>
    <button ng-click="modal.onConfirm()">Confirm</button>
    <button ng-click="modal.onCancel()">Cancel</button>
  </footer>
</section>
```

### API

| name | type | info |
| ---- | ---- | ---- |
| templateUrl | STRING | 模版路径 (仅支持 absUrl) |
| controller | FUNCTION | 模版 controller |
| controllerAs | STRING | 模版 alias |
| parentElement | DOM | 可选参数，模版容器 (未指定则用 body) |
| template | STRING | 模版 html |

### LICENSE

MIT

---
_Source: https://npm.io/package/ngdialog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
