AngularJS: Refreshing the parent page after the modal window closed

Subbu G
Subbu G used Ask the Experts™
on
Experts,

I have a page designed using AngularJS, bootstrap and HTML5. I have a button which opens the dialog to perform an edit operation and when I click save button I would like to close the window and refresh the parent page.

Parent page: Milestone.html/ MilestoneCtrl
Modal: MODALMILESTONEORDERING.html/ MODALMILESTONEORDERINGCTRL


MODALMILESTONEORDERING.html

<div class="modal-header">
    <h3 class="modal-title">Re-order Milestones</h3>
</div>
<div class="modal-body">
    <div ng-hide="Milestone.isEditing" ng-if="mainMenu.HasPermissions('EditMilestone')">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 ">
                <input class="form-control" id="MilestoneSearch" placeholder="Search Milestones..." ng-model="Milestone.searchText" ng-model-options="{ debounce: 800 }" type="search" />
            </div>
        </div>
        <br />
        <br />
        <system-alert></system-alert>
        <div class="modal-list-section">
            <div class="row">
                <label class="col-xs-6 col-sm-6 col-md-3 col-lg-2">Name</label>
                <label class="col-xs-6 col-sm-6 col-md-3 col-lg-5">Description</label>
                <label class="col-xs-6 col-sm-6 col-md-3 col-lg-5">Order Sequence</label>
            </div>
            <div class="row anim-fade list-row" ng-repeat="milestone in Milestone.milestones | orderBy: 'Order' | filter: Milestone.searchText" ng-class-even="'green-bar'">
                <span class="col-xs-6 col-sm-6 col-md-3 col-lg-2">{{milestone.Name}}</span>
                <span class="col-xs-6 col-sm-6 col-md-3 col-lg-5">{{milestone.Description}}</span>
                <span class="col-xs-6 col-sm-6 col-md-3 col-lg-5">
                    <div class="input-group-sm">
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-agency" ng-click="Milestone.reorder.moveDown($index, milestone)" ng-disabled="$index===0">⇑</button>
                        </span>
                        <input type="text" class="form-control" ng-model="milestone.Order" ng-blur="Milestone.reorder.moveTo($index, milestone)" model-format="digit"
                               ng-change="Milestone.reorder.moveTo($index, milestone)" required />
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-agency" ng-click="Milestone.reorder.moveUp($index, milestone)" ng-disabled="$last===true">⇓</button>
                        </span>
                    </div>
                </span>
            </div>
        </div>
    </div>
</div>
<div class="modal-footer">
    <button class="btn btn-agency btn-sm" type="button" ng-click="Milestone.save()"><i class="fa fa-save"></i>Save</button>
    <button class="btn btn-agency btn-sm" type="button" ng-click="$dismiss(Milestone.deletedMilestones)"><i class="fa fa-ban"></i>Cancel</button>
</div>

Open in new window

.
ModalMilestoneOrderingCtrl.js
MilestoneCtrl.js
MilestoneController.cs
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
try

window.top.location.reload(); or parent.location.reload();

Author

Commented:
It did not fix my problem.

Author

Commented:
I would like to refresh my parent page [Milestone.html] when I close my modal popup [ModalMilestoneOrdering.html] when I click save or close from my modal popup .

working.JPG
@AlexCode

can you help me out?
ModalMilestoneOrderingCtrl.js
MilestoneCtrl.js
ModalMilestoneOrdering.html
Milestone.html

Author

Commented:
@contactkarthi

Is there any other way to do this parent page refresh?

Author

Commented:
Thanks It fixed my problem. Thanks Karthi. I was doing some mistake. good solution for my problem

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial