"use strict";

angular.module('arethusa.comments').service('comments', [
  'state',
  'configurator',
  'navigator',
  function(state, configurator, navigator) {
    var self = this;
    var retriever;

    this.defaultConf = {
      name: "comments",
      template: "templates/arethusa.comments/comments.html"
    };

    function configure() {
      configurator.getConfAndDelegate('comments', self);
      retriever = configurator.getRetriever(self.conf.retriever);
    }

    configure();

    function retrieveComments() {
      self.comments = {};
      retriever.getData(navigator.status.currentId, function(comments) {
        angular.extend(self.comments, comments);
      });
    }

    this.init = function() {
      configure();
      retrieveComments();
    };
  }
]);

@@ -110,16 +110,31 @@
 gator',%0A
+  'idHandler',%0A
   functi
@@ -166,16 +166,27 @@
 avigator
+, idHandler
 ) %7B%0A    
@@ -220,16 +220,31 @@
 triever;
+%0A    var idMap;
 %0A%0A    th
@@ -700,16 +700,30 @@
 mments, 
+withMappedIds(
 comments
@@ -723,16 +723,17 @@
 omments)
+)
 ;%0A      
@@ -739,24 +739,291 @@
  %7D);%0A    %7D%0A%0A
+    function withMappedIds(comments) %7B%0A      return arethusaUtil.inject(%7B%7D, comments, function(memo, id, comment) %7B%0A        memo%5BidMap%5Bid%5D%5D = comment;%0A      %7D);%0A    %7D%0A%0A    function createIdMap() %7B%0A      idMap = idHandler.sourceIdMap(state.tokens, 'treebank');%0A    %7D%0A%0A
     this.ini
@@ -1054,24 +1054,45 @@
 onfigure();%0A
+      createIdMap();%0A
       retrie

Add id mapping to comments service