3

Towards the end of the documentation for Angular UI modal directive, it is written

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

I see this is implemented in commit http://github.com/angular-ui/bootstrap/commit/8d153acb

Is there any example on how to use it. I too like to avoid writing a controller for the example given in the doc. plnkr . So, I am seeking a way to avoid creating ModalInstanceCtrl for simple functionalities (input through a form, displaying some data).

1 Answer 1

4

in your modal form simply use:

<button ng-click="$close(result)">OK</button>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.