2013-12-20 81 views
3

走向爲Angular UI modal directive文檔的末尾,寫角UI模式的指令

In addition the scope associated with modal's content is augmented with 2 methods: * $close(result) * $dismiss(reason) Those methods make it easy to close a modal window without a need to create a dedicated controller

我認爲這是實現在提交 http://github.com/angular-ui/bootstrap/commit/8d153acb

是否有關於如何使用任何實例它。我也想避免爲文檔中給出的示例編寫控制器。 plnkr。所以,我正在尋求一種避免爲簡單功能創建ModalInstanceCtrl(通過表單輸入,顯示一些數據)的方法。

回答

4

在你的模式窗體簡單地使用:

<button ng-click="$close(result)">OK</button>