{"action":"closed","issue":{"url":"https://api.github.com/repos/aurelia/validation/issues/358","repository_url":"https://api.github.com/repos/aurelia/validation","labels_url":"https://api.github.com/repos/aurelia/validation/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/validation/issues/358/comments","events_url":"https://api.github.com/repos/aurelia/validation/issues/358/events","html_url":"https://github.com/aurelia/validation/issues/358","id":181844564,"number":358,"title":"ValidationController.addRenderer() use case issue","user":{"login":"zeko77","id":2051469,"avatar_url":"https://avatars.githubusercontent.com/u/2051469?v=3","gravatar_id":"","url":"https://api.github.com/users/zeko77","html_url":"https://github.com/zeko77","followers_url":"https://api.github.com/users/zeko77/followers","following_url":"https://api.github.com/users/zeko77/following{/other_user}","gists_url":"https://api.github.com/users/zeko77/gists{/gist_id}","starred_url":"https://api.github.com/users/zeko77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeko77/subscriptions","organizations_url":"https://api.github.com/users/zeko77/orgs","repos_url":"https://api.github.com/users/zeko77/repos","events_url":"https://api.github.com/users/zeko77/events{/privacy}","received_events_url":"https://api.github.com/users/zeko77/received_events","type":"User","site_admin":false},"labels":[{"id":185762739,"url":"https://api.github.com/repos/aurelia/validation/labels/bug","name":"bug","color":"fc2929","default":true},{"id":432425563,"url":"https://api.github.com/repos/aurelia/validation/labels/documentation","name":"documentation","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":{"login":"jdanyow","id":1306747,"avatar_url":"https://avatars.githubusercontent.com/u/1306747?v=3","gravatar_id":"","url":"https://api.github.com/users/jdanyow","html_url":"https://github.com/jdanyow","followers_url":"https://api.github.com/users/jdanyow/followers","following_url":"https://api.github.com/users/jdanyow/following{/other_user}","gists_url":"https://api.github.com/users/jdanyow/gists{/gist_id}","starred_url":"https://api.github.com/users/jdanyow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdanyow/subscriptions","organizations_url":"https://api.github.com/users/jdanyow/orgs","repos_url":"https://api.github.com/users/jdanyow/repos","events_url":"https://api.github.com/users/jdanyow/events{/privacy}","received_events_url":"https://api.github.com/users/jdanyow/received_events","type":"User","site_admin":false},"assignees":[{"login":"jdanyow","id":1306747,"avatar_url":"https://avatars.githubusercontent.com/u/1306747?v=3","gravatar_id":"","url":"https://api.github.com/users/jdanyow","html_url":"https://github.com/jdanyow","followers_url":"https://api.github.com/users/jdanyow/followers","following_url":"https://api.github.com/users/jdanyow/following{/other_user}","gists_url":"https://api.github.com/users/jdanyow/gists{/gist_id}","starred_url":"https://api.github.com/users/jdanyow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdanyow/subscriptions","organizations_url":"https://api.github.com/users/jdanyow/orgs","repos_url":"https://api.github.com/users/jdanyow/repos","events_url":"https://api.github.com/users/jdanyow/events{/privacy}","received_events_url":"https://api.github.com/users/jdanyow/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-10-08T19:36:01Z","updated_at":"2016-11-30T03:49:14Z","closed_at":"2016-11-30T03:49:14Z","body":"**I'm submitting a bug report**\n- **Library Version:**\n  0.13.1\n\n**Please tell us about your environment:**\n- **Operating System:**\n  Windows [10]\n- **Node Version:**\n  6.2.0\n- **NPM Version:**\n  3.10.3\n- **JSPM OR Webpack AND Version**\n  JSPM 0.16.46\n- **Browser:**\n  all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView\n- **Language:**\n  all\n\n**Current behavior:**\nAccording to documentation, it is recommended that\nvalidationController,addRenderer(new BootstrapFormRenderer()); is executed in constructor of viewmodel. As validationController is singleton, renderer is added each time view is navigated to, resulting in multiple error messages during validation. Even if renderer is removed in view's deactivate method, removal can still be bypassed with aurelia.setRoot(), which makes this kind of renderer garbage-collection inconvenient\n\n**Expected/desired behavior:**\nEvery validation error should be rendered only once, no matter how many times the view is created/navigated to.\n\nI have managed to bypass this issue in main.js by importing\n\nimport {ValidationController } from 'aurelia-validation';\nimport {BootstrapFormRenderer} from 'common/bootstrap-form-renderer';\nimport {Container} from 'aurelia-dependency-injection';\n\nand\n\naurelia.start().then(() => {\n          Container.instance.get(ValidationController).addRenderer(new BootstrapFormRenderer());\n            aurelia.setRoot(\"shell\");\n        });\n"}}
{"actor":{"display_login":"jdanyow"}}