且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ng-click第一次没有开火第二次工作

更新时间:2023-02-25 20:49:15

q.all([clearAnswersPromise])。然后( function (数据){
vm.checkForInvalidAnswers();
})。then( function (){
vm.processNextFinal(); // 这将使
q.all([clearAnswersPromise]).then(function (data) { vm.checkForInvalidAnswers(); }).then(function () { vm.processNextFinal();//this will make


http call
});
..........

});

app.controller(' formCtrl' function (QuestionService){
var vm = this ;
vm.QuestionService = QuestionService;


});
http call }); .......... }); app.controller('formCtrl',function(QuestionService){ var vm = this; vm.QuestionService = QuestionService; });







............
 <button class="button--primary button pull-right bc-questions"  type="button" ng-click="vm.QuestionService.goNext ()">
                        Next
                    </button>
..............





第一次有效,但在我转到下一页后,我回来了到这个表单修改一些信息,这次当我点击时,按钮不会做任何事情,必须再次点击然后才能工作。



看来很奇怪,有谁知道如何解决这个问题?由于这只是不起火事件,似乎没有任何逻辑问题。我完全迷失了:(



For first time it works, but after i go to the next page, then i come back to this form modify some information, this time when I click, the button won't do anything, must click the second time then works.

It seems very strange, has anyone know how to solve this issue? Since this just don't fire event, and don't seems that have any logic issue. I am totally lost :(