Click here to Skip to main content
15,921,577 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have data service hold booking from questions and
JavaScript
app.factory('QuestionService',function(){
 ..........
  vm.goNext = function () {
                 var clearAnswersPromise = vm.clearInvalidAnswers();

                $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;
 

});


HTML
............
 <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 :(
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900