{"action":"created","issue":{"url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/442","repository_url":"https://api.github.com/repos/valor-software/ng2-dragula","labels_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/442/comments","events_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/442/events","html_url":"https://github.com/valor-software/ng2-dragula/issues/442","id":182253549,"number":442,"title":"Bag named: \"section-bag\" already exists","user":{"login":"Bhushan001","id":7402241,"avatar_url":"https://avatars.githubusercontent.com/u/7402241?v=3","gravatar_id":"","url":"https://api.github.com/users/Bhushan001","html_url":"https://github.com/Bhushan001","followers_url":"https://api.github.com/users/Bhushan001/followers","following_url":"https://api.github.com/users/Bhushan001/following{/other_user}","gists_url":"https://api.github.com/users/Bhushan001/gists{/gist_id}","starred_url":"https://api.github.com/users/Bhushan001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bhushan001/subscriptions","organizations_url":"https://api.github.com/users/Bhushan001/orgs","repos_url":"https://api.github.com/users/Bhushan001/repos","events_url":"https://api.github.com/users/Bhushan001/events{/privacy}","received_events_url":"https://api.github.com/users/Bhushan001/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-11T12:42:40Z","updated_at":"2016-10-31T19:34:47Z","closed_at":null,"body":"hi ,\nI have a sectionComponent which has another component.\n\nsection.component.html\n\n`<div [dragula]='\"section-bag\"'>\n  <*ngFor=\"let row of section.rows\">\n   <row [row]=\"row\">Loading....</row>\n</div>`\n\nsection.component.ts\n\n`constructor(private dragulaService: DragulaService) {\n    this.dragulaService.setOptions('section-bag', {\n      revertOnSpill: true\n    });\n  }`\n\nnow when I am adding a new section, it says \n\n> Bag named: \"section-bag\" already exists\n\nany solution?\n"},"comment":{"url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/comments/257396710","html_url":"https://github.com/valor-software/ng2-dragula/issues/442#issuecomment-257396710","issue_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/442","id":257396710,"user":{"login":"borislemke","id":10104993,"avatar_url":"https://avatars.githubusercontent.com/u/10104993?v=3","gravatar_id":"","url":"https://api.github.com/users/borislemke","html_url":"https://github.com/borislemke","followers_url":"https://api.github.com/users/borislemke/followers","following_url":"https://api.github.com/users/borislemke/following{/other_user}","gists_url":"https://api.github.com/users/borislemke/gists{/gist_id}","starred_url":"https://api.github.com/users/borislemke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borislemke/subscriptions","organizations_url":"https://api.github.com/users/borislemke/orgs","repos_url":"https://api.github.com/users/borislemke/repos","events_url":"https://api.github.com/users/borislemke/events{/privacy}","received_events_url":"https://api.github.com/users/borislemke/received_events","type":"User","site_admin":false},"created_at":"2016-10-31T19:34:47Z","updated_at":"2016-10-31T19:34:47Z","body":"I think a better solution would be to implement a unique ID for each bag:\r\n\r\n```javascript\r\nsome.component.ts\r\n...\r\n\r\nlet _uniqueId = 0;\r\n\r\n@Component({\r\n    ...\r\n    template: `\r\n         <div [dragula]=\"uniqueBagId\"></div>\r\n    `\r\n})\r\nexport class AComponentThatUsesDragula {\r\n\r\n    uniqueBagId: string;\r\n\r\n    constructor(private dragulaService: DragulaService) {\r\n         this.uniqueBagId = 'dragula-bag-' + _uniqueId++;\r\n\r\n         dragulaService.setOptions('section-bag', { revertOnSpill: true } );\r\n    }\r\n    ...\r\n}\r\n\r\n```"}}
{"actor":{"display_login":"borislemke"}}