MoodCat / MoodCat.me-Frontend

2 stars 0 forks source link

Classification in room is treated equally to classification game #141

Closed jwgmeligmeyling closed 8 years ago

jwgmeligmeyling commented 9 years ago

It should go to a different endpoint and send the current room with the response (and this should be used for sanity checking the request)

Easy fix after #140

TimvdLippe commented 9 years ago

https://docs.angularjs.org/guide/directive#isolating-the-scope-of-a-directive can be used.

angular.module('docsIsolateScopeDirective', [])
.controller('Controller', ['$scope', function($scope) {
  $scope.naomi = { name: 'Naomi', address: '1600 Amphitheatre' };
  $scope.igor = { name: 'Igor', address: '123 Somewhere' };
}])
.directive('myCustomer', function() {
  return {
    restrict: 'E',
    scope: {
      customerInfo: '=info'
    },
    templateUrl: 'my-customer-iso.html'
  };
});
jwgmeligmeyling commented 9 years ago

I am aware of scope and directives, but we already use them, what solution do you have in mind?

TimvdLippe commented 9 years ago

Depending on the end-point attribute of a directive, we can send it to the corresponding end-point on the Backend.

We can then add a 3rd parameter to https://github.com/MoodCat/MoodCat.me-Frontend/blob/master/app/scripts/services/classify/classificationService.js#L13 called from https://github.com/MoodCat/MoodCat.me-Frontend/blob/master/app/scripts/directives.js#L78 with the corresponding attribute.

jwgmeligmeyling commented 9 years ago

The behaviour also needs to change. We should add the room with the request for the classification game. (So we can sanity check the request, the song should be actually playing)

jwgmeligmeyling commented 9 years ago

I think this endpoint solution is good by the way. But I'm still hoping for a better solution to program the classify game next to the room listening anyway (getting rid of the state transition event listener and fixing the audio playback if you exit the classify game)