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; });
............ <button class="button--primary button pull-right bc-questions" type="button" ng-click="vm.QuestionService.goNext ()"> Next </button> ..............
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)