{"action":"created","issue":{"url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/218","repository_url":"https://api.github.com/repos/open-xml-templating/docxtemplater","labels_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/218/comments","events_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/218/events","html_url":"https://github.com/open-xml-templating/docxtemplater/issues/218","id":148678232,"number":218,"title":"using custom filters inside {#bool} {/bool}","user":{"login":"martinWalnut","id":15138796,"avatar_url":"https://avatars.githubusercontent.com/u/15138796?v=3","gravatar_id":"","url":"https://api.github.com/users/martinWalnut","html_url":"https://github.com/martinWalnut","followers_url":"https://api.github.com/users/martinWalnut/followers","following_url":"https://api.github.com/users/martinWalnut/following{/other_user}","gists_url":"https://api.github.com/users/martinWalnut/gists{/gist_id}","starred_url":"https://api.github.com/users/martinWalnut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinWalnut/subscriptions","organizations_url":"https://api.github.com/users/martinWalnut/orgs","repos_url":"https://api.github.com/users/martinWalnut/repos","events_url":"https://api.github.com/users/martinWalnut/events{/privacy}","received_events_url":"https://api.github.com/users/martinWalnut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-15T14:38:38Z","updated_at":"2016-04-17T13:54:41Z","closed_at":null,"body":"I have bumped into the following problem. \r\n\r\nMy data: \r\n\r\nvar bool = false;\r\nvar array = [{name: 'a', age: 8}, {name: 'b', age: 39}]\r\nvar findByDate - a filter that finds object in array and returns its name property.\r\n\r\nThen in my word template i have: \r\n{#bool} {array | findByAge:'8'}{/bool}\r\n\r\nThis doesnt work and throws err \r\n....\\docxtemplater\\js\\scopeManager.js:84\r\n      throw err;\r\n      ^\r\n Error\r\n    at Object.<anonymous> (C:\\Users\\Mroz\\Documents\\falafel\\node_modules\\docxtemplater\\js\\errors.js:9:21)\r\n    at Module._compile (module.js:398:26)\r\n    at Object.Module._extensions..js (module.js:405:10)\r\n    at Module.load (module.js:344:32)\r\n    at Function.Module._load (module.js:301:12)\r\n    at Module.require (module.js:354:17)\r\n    at require (internal/module.js:12:17)\r\n    at Object.<anonymous> (C:\\Users\\Mroz\\Documents\\falafel\\node_modules\\docxtemplater\\js\\docUtils.js:4:10)\r\n    at Module._compile (module.js:398:26)\r\n    at Object.Module._extensions..js (module.js:405:10)\r\n\r\n\r\nBut for example only this, when it is not wrapped inside my conditioning bool, everything works fine \r\n\r\n{array | findByAge:'8'} \r\n\r\nrenders objects name;\r\n\r\n\r\nAny ideas how to handle this? "},"comment":{"url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/comments/211023373","html_url":"https://github.com/open-xml-templating/docxtemplater/issues/218#issuecomment-211023373","issue_url":"https://api.github.com/repos/open-xml-templating/docxtemplater/issues/218","id":211023373,"user":{"login":"edi9999","id":2071336,"avatar_url":"https://avatars.githubusercontent.com/u/2071336?v=3","gravatar_id":"","url":"https://api.github.com/users/edi9999","html_url":"https://github.com/edi9999","followers_url":"https://api.github.com/users/edi9999/followers","following_url":"https://api.github.com/users/edi9999/following{/other_user}","gists_url":"https://api.github.com/users/edi9999/gists{/gist_id}","starred_url":"https://api.github.com/users/edi9999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edi9999/subscriptions","organizations_url":"https://api.github.com/users/edi9999/orgs","repos_url":"https://api.github.com/users/edi9999/repos","events_url":"https://api.github.com/users/edi9999/events{/privacy}","received_events_url":"https://api.github.com/users/edi9999/received_events","type":"User","site_admin":false},"created_at":"2016-04-17T13:54:41Z","updated_at":"2016-04-17T13:54:41Z","body":"I'm reopening this to remember to add the \"originalError\" in the properties, so that users get more useful information"}}