Enhancing index, view and dashboard ui

This commit is contained in:
achrafbenyounes
2014-12-18 18:02:39 +01:00
parent d712eb3a59
commit c4a7b1f129
23 changed files with 2122 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
var gradeDirective = angular.module('gradeDirective', []);
gradeDirective.directive('grade', function() {
return {
restrict: 'E',
scope: {
score: '=score'
},
template: '<div ng-class="getGrade(score)">{{getGrade(score)}}</div>',
replace: true,
controller : function($scope) {
$scope.getGrade = function(score) {
console.log(score);
if (score >= 85) {
return 'A';
}
if (score >= 65) {
return 'B';
}
if (score >= 45) {
return 'C';
}
if (score >= 30) {
return 'D';
}
if (score >= 15) {
return 'E';
}
return 'F';
}
}
};
});