{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/angular-instantsearch/issues/114","repository_url":"https://api.github.com/repos/algolia/angular-instantsearch","labels_url":"https://api.github.com/repos/algolia/angular-instantsearch/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/algolia/angular-instantsearch/issues/114/comments","events_url":"https://api.github.com/repos/algolia/angular-instantsearch/issues/114/events","html_url":"https://github.com/algolia/angular-instantsearch/issues/114","id":321578394,"number":114,"title":"Documentation transformItems","user":{"login":"aymericaitamer","id":5576207,"avatar_url":"https://avatars2.githubusercontent.com/u/5576207?v=4","gravatar_id":"","url":"https://api.github.com/users/aymericaitamer","html_url":"https://github.com/aymericaitamer","followers_url":"https://api.github.com/users/aymericaitamer/followers","following_url":"https://api.github.com/users/aymericaitamer/following{/other_user}","gists_url":"https://api.github.com/users/aymericaitamer/gists{/gist_id}","starred_url":"https://api.github.com/users/aymericaitamer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aymericaitamer/subscriptions","organizations_url":"https://api.github.com/users/aymericaitamer/orgs","repos_url":"https://api.github.com/users/aymericaitamer/repos","events_url":"https://api.github.com/users/aymericaitamer/events{/privacy}","received_events_url":"https://api.github.com/users/aymericaitamer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-09T13:49:38Z","updated_at":"2018-05-09T14:26:30Z","closed_at":"2018-05-09T14:26:30Z","author_association":"NONE","body":"Hi Algolia,\r\n\r\nYou added transformItems on refinement list : https://github.com/algolia/angular-instantsearch/commit/9b7a007\r\n\r\nBut there is no documentation about it : https://community.algolia.com/angular-instantsearch/widgets/refinement-list.html\r\n\r\nI try to do this :\r\n```\r\n<ng-ais-refinement-list attribute=\"category\" [sortBy]=\"['name','desc']\" showMoreLabel=\"See more\" showLessLabel=\"See less\"\r\n            [limit]=\"3\" [showMoreLimit]=\"100\" [transformItems]=\"translate(items)\"></ng-ais-refinement-list>\r\n\r\n```\r\n=> translate function is invoked but items is undefined. Do you have a demo with transformItems  that works ?\r\n\r\nNB : To understand my need, i have to translate item facets.\r\n"},"comment":{"url":"https://api.github.com/repos/algolia/angular-instantsearch/issues/comments/387757153","html_url":"https://github.com/algolia/angular-instantsearch/issues/114#issuecomment-387757153","issue_url":"https://api.github.com/repos/algolia/angular-instantsearch/issues/114","id":387757153,"user":{"login":"Haroenv","id":6270048,"avatar_url":"https://avatars3.githubusercontent.com/u/6270048?v=4","gravatar_id":"","url":"https://api.github.com/users/Haroenv","html_url":"https://github.com/Haroenv","followers_url":"https://api.github.com/users/Haroenv/followers","following_url":"https://api.github.com/users/Haroenv/following{/other_user}","gists_url":"https://api.github.com/users/Haroenv/gists{/gist_id}","starred_url":"https://api.github.com/users/Haroenv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Haroenv/subscriptions","organizations_url":"https://api.github.com/users/Haroenv/orgs","repos_url":"https://api.github.com/users/Haroenv/repos","events_url":"https://api.github.com/users/Haroenv/events{/privacy}","received_events_url":"https://api.github.com/users/Haroenv/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T14:26:30Z","updated_at":"2018-05-09T14:26:30Z","author_association":"MEMBER","body":"Hey @aymericaitamer, \r\n\r\nThe function should not be called, but rather passed as reference. Like this:\r\n\r\n```html\r\n<ng-ais-refinement-list attribute=\"category\" [sortBy]=\"['name','desc']\" showMoreLabel=\"See more\" showLessLabel=\"See less\"\r\n            [limit]=\"3\" [showMoreLimit]=\"100\" [transformItems]=\"translate\"></ng-ais-refinement-list>\r\n```\r\n\r\nHowever, note that the function should change the `highlighted` value for it to show in the default template. Like this:\r\n\r\n```ts\r\nimport { Component } from '@angular/core';\r\n\r\nconst translationTable = {\r\n  Apple: 'pomme',\r\n};\r\n\r\n@Component({\r\n  selector: 'app-root',\r\n  templateUrl: './app.component.html',\r\n  styleUrls: ['./app.component.scss'],\r\n})\r\nexport class AppComponent {\r\n  title = 'app';\r\n  translate(items) {\r\n    return items.map(item => ({\r\n      ...item,\r\n      label: translationTable[item.label] || item.label, // not displayed\r\n      highlighted: translationTable[item.highlighted] || item.highlighted, // the displayed one\r\n    }));\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"Haroenv"}}