37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
"use strict";
|
|
/**
|
|
* Created by sohan.rao on 06/03/2015.
|
|
*/
|
|
(function () {
|
|
'use strict';
|
|
angular.module('myitsmApp')
|
|
.directive('questionsList', [
|
|
function () {
|
|
return {
|
|
restrict: 'E',
|
|
scope: {
|
|
list: '=',
|
|
actionBtnClick: '=',
|
|
listContext: '@',
|
|
duplicateArticlesList: '='
|
|
},
|
|
templateUrl: 'views/common/questions-list.html',
|
|
link: function (scope) {
|
|
scope.setCurrentContext = function (question) {
|
|
var params = {
|
|
currentContext: question
|
|
};
|
|
scope.actionBtnClick(question.actionType, params);
|
|
};
|
|
scope.setAnswer = function (todo, question) {
|
|
question.desirableAnswer = todo;
|
|
if (!todo && question.actionType === 'CHECK_DUPLICATE') {
|
|
scope.actionBtnClick('REMOVE_DUPLICATES');
|
|
}
|
|
};
|
|
}
|
|
};
|
|
}
|
|
]);
|
|
}());
|