Closed jwgmeligmeyling closed 8 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'
};
});
I am aware of scope and directives, but we already use them, what solution do you have in mind?
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.
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)
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)
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