Я изучаю обещания и борюсь со следующим.AngularJS: Добавление переменной в цепочку обещаний
В этом случае выполняются три функции.
//returns an search query in JSON format
filterSearch()
// searches Parse.com and returns an array of values
.then(performSearch)
// I am passing the array of values to exerciseSearch and a another value (term - string)
.then(function(result) {
exerciseSearch(result, term);
})
// The results from the search is displayed in scope.
.then(function(exercises) {
$scope.allExercises = exercises;
}, function(error) {
console.log('error');
});
Вы, вероятно, означало 'вернуть exerciseSearch (результат, термин)' – Bergi