angular.js - AngularJS ng-show value is already true, but ng-hide is still displayed
淡淡烟草味
淡淡烟草味 2017-05-15 17:04:23
0
1
636

Use ng-show to control a pop-up box

Change the value of value in the click event of a button (using jQuery Ajax)

Through the console.log, I can see that the value of value has indeed become true, but when I click the button, the order exception box does not pop up. The second click will pop up
Why is it necessary? Execute twice to pop up?
Put $scope.value = true; outside Ajax to pop up the box at once.
Replacing $scope.valuer with $rootScope won’t work either.
Solution.

淡淡烟草味
淡淡烟草味

reply all(1)
某草草
$scope.RealTimeUpdate = function (obj) {
    var thisRurl = '/MFreeXFapi/student/RealTimeUpdate';
    var rturl = $(obj).attr('rthref');
    $http({
        method: 'POST',
        url: thisRurl,
        transformRequest: $.param,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded;' },
        data: 'ProductId=' + $rootScope.paycourseId + '&studentid=' + $scope.userData.rowId + '&orderid=' + $scope.payood,
    }).success(function (data) {
        if (data != true) {
            $scope.orderError = true;
            console.log($scope.orderError)

        } else {
            window.location.href = rturl
        }
    })
};

jq’s ajax will not trigger ng’s checking mechanism. You need to use $http instead or use $scope.$apply after changing the model

http://stackoverflow.com/ques...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template