Anup Vasudeva
Anup Vasudeva

Reputation: 901

Angular JS: Perform DOM manipulation after modal dialog is closed

I'm new to Angular JS. I have set up a plunker to demonstrate the situation:
http://plnkr.co/edit/P90BIfQRcnh1xTX0xqWT?p=preview

On the modal dialog gets closed, I need to show the span next to the continue button. How should I proceed?

Thanks for reading.

Upvotes: 1

Views: 376

Answers (1)

Ye Liu
Ye Liu

Reputation: 8976

I've made a few changes to the plunk to make it work:

  1. Get rid of ng-controller in modal.html, since you've binded ModalController to <body> already
  2. Add a model called "done" to scope i.e. $scope.done = false
  3. Use ng-show="done" in the "Work completed" span, so the span's shown/hidden states are determined by the "done" model
  4. In your model.continue(), set "done" to true to show the "Work completed" span

Updated plunk is here: http://plnkr.co/edit/DRvXlRP2UOwGaxHjcrfN

Upvotes: 1

Related Questions