簡體   English   中英

AngularJs $ mdDialog關閉禁用頁面

[英]AngularJs $mdDialog close disables page

關閉mdDialog時出現問題, 這是我嘗試使用.hide()函數的closePop,但是我也遇到了同樣的問題。 { $mdDialog.cancel(); // $mdDialog.hide(); } { $mdDialog.cancel(); // $mdDialog.hide(); }

當我點擊對話框上的關閉按鈕時,主視圖有點凍結,ng-click不再起作用,這是模板:

<!--<div layout="row" class="tab-body room-tab-item" layout-wrap>-->

    <div elem-ready="$ctrl.loadData($ctrl.broadcaster.id)"></div>
<div class="calendar-tab-header"> Click on a date to add it into your time table</div>
<div>Items are displayed in your current time zone.</div>
    <div class="calendar-tab-success">{{$ctrl.success}}</div>
    <div class="calendar-tab-error">{{$ctrl.error}}</div>
    <table class="calendar-tab-my-timetable">
        <thead>
        <tr>
            <th>Date and Hour</th>
        </tr>
        </thead>
    </table>


        <button ng-repeat="schedule in $ctrl.schedules" ng-click="$ctrl.checkIn(schedule.id)">
            <td><div class="calendar-tab-date">{{schedule.date}}</div>
                <div class="calendar-tab-hour">{{schedule.startHour}}:00</div>
            </td>
            <!--<td>{{game.release}}</td>-->
        </button>



</div>

` checkIn函數僅加載模態,在第一次單擊時它起作用,但是當我使用關閉模態函數時,它關閉模態,但是我無法再次單擊按鈕再次顯示模態,我認為它禁用了ng-點擊

    $mdDialog.show({
                controllerAs: 'ctrl',
                templateUrl: 'modal.view.html',
                parent: angular.element(document.body),
                // targetEvent: ev,
                clickOutsideToClose: false,
                scope: $scope
            }).then(function (scope) {
            }, function () {});

有人能幫助我嗎?

reserveScope:正確

 $mdDialog.show({
                controllerAs: 'ctrl',
                templateUrl: 'modal.view.html',
                parent: angular.element(document.body),
                // targetEvent: ev,
                preserveScope: true,
                clickOutsideToClose: false,
                scope: $scope
            }).then(function (scope) {
            }, function () {});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM