26 lines
813 B
JavaScript
26 lines
813 B
JavaScript
"use strict";
|
|
(function () {
|
|
'use strict';
|
|
angular.module('myitsmApp').provider('topicLogger', [function () {
|
|
var topics = [];
|
|
this.addTopic = function (topic) {
|
|
if (topics.indexOf(topic) == -1) {
|
|
topics.push(topic);
|
|
}
|
|
};
|
|
this.removeTopic = function (topic) {
|
|
var topicIndex = topics.indexOf(topic);
|
|
if (topicIndex > -1) {
|
|
topics.splice(topicIndex, 1);
|
|
}
|
|
};
|
|
this.getTopics = function () {
|
|
return topics;
|
|
};
|
|
this.includesTopic = function (topic) {
|
|
return topics.indexOf(topic) > -1;
|
|
};
|
|
this.$get = function () { };
|
|
}]);
|
|
})();
|