(function () { "use strict"; var QuestionController = function ($scope, $location, userService, sharingService) { $scope.model = { question: '' }; sharingService.getContacts().then(function (data) { $scope.hasConnections = data.data && data.data.length; }); $scope.callbackCustom = function (question) { $scope.errorMessage = ''; if (question.length > 10 && question.length <= 750) { userService.addQuestion(question) .then((prompt) => $location.url('question/' + prompt.promptId + '/ask') ); } else { $scope.errorMessage = 'A custom question needs to have at least 10 and less than 750 characters.'; } }; }; QuestionController.$inject = ['$scope', '$location', 'userService', 'sharingService']; angular.module('streamApp').controller('questionAddController', QuestionController); })();