Skip to content

Instantly share code, notes, and snippets.

@barek2k2
Last active December 17, 2015 14:39
Show Gist options
  • Save barek2k2/5626515 to your computer and use it in GitHub Desktop.
Save barek2k2/5626515 to your computer and use it in GitHub Desktop.
angular with coffee
if $scope.session.current.doctor_profile.is_active
$http.get("/api/v1/users/0/assigned_questions").success(
(r)->
newr = []
for e in r
e.replying = false
e.autoAssigned = false
newr.push e
$http.get("/api/v1/auto_assigned_questions.json").success(
(resp)->
for lol in resp
lol.replying = false
lol.autoAssigned = true
newr.push lol
$scope.unansweredQuestions = newr
if $scope.unansweredQuestions.length > 0
$scope.assignedQuestions = true
else
$scope.assignedQuestions = false
console.log $scope.unansweredQuestions
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment