{"action":"closed","issue":{"url":"https://api.github.com/repos/ga-dc/project3/issues/111","labels_url":"https://api.github.com/repos/ga-dc/project3/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/ga-dc/project3/issues/111/comments","events_url":"https://api.github.com/repos/ga-dc/project3/issues/111/events","html_url":"https://github.com/ga-dc/project3/issues/111","id":121524829,"number":111,"title":"Attaching an event listener to async generated content","user":{"login":"tylercrosse","id":10747860,"avatar_url":"https://avatars.githubusercontent.com/u/10747860?v=3","gravatar_id":"","url":"https://api.github.com/users/tylercrosse","html_url":"https://github.com/tylercrosse","followers_url":"https://api.github.com/users/tylercrosse/followers","following_url":"https://api.github.com/users/tylercrosse/following{/other_user}","gists_url":"https://api.github.com/users/tylercrosse/gists{/gist_id}","starred_url":"https://api.github.com/users/tylercrosse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylercrosse/subscriptions","organizations_url":"https://api.github.com/users/tylercrosse/orgs","repos_url":"https://api.github.com/users/tylercrosse/repos","events_url":"https://api.github.com/users/tylercrosse/events{/privacy}","received_events_url":"https://api.github.com/users/tylercrosse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ga-dc/project3/labels/waiting%20on%20student%20response","name":"waiting on student response","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-10T16:26:48Z","updated_at":"2015-12-10T18:45:45Z","closed_at":"2015-12-10T18:45:45Z","body":"```\r\n       ________              \r\n   _jgN########Ngg_          \r\n _N##N@@\"\"  \"\"9NN##Np_       \r\nd###P            N####p      \r\n\"^^\"              T####      \r\n                  d###P      \r\n               _g###@F       \r\n            _gN##@P          \r\n          gN###F\"            \r\n         d###F               \r\n        0###F     Halp!  \r\n        0###F   Oh god! Please!\r\n        0###F                \r\n        \"NN@'                \r\n                             \r\n         ___                 \r\n        q###r                \r\n         \"\"      \r\n```\r\nSame Issue Day 2:\r\nI'm trying to attach an event listener to content that is being generated asynchronously and it's not going so hot.\r\n\r\nWe've got a page with some filters at the top and user cards at the bottom. We want the filters to filter which cards are shown. The cards are generated with \r\n```\r\nusers.forEach( function(user) {\r\n  var renUsers = new UserView(user).renderUsers(user);\r\n});\r\n```\r\nThe event listener works when it's in `js/views/userView.js`\r\n```\r\nvar UserView = function(user) {\r\n  this.$el blah blah blah...\r\n\r\n  $('#filterLocation').change(function() {\r\n    // FILTER STUFF (this works, omitted for brevity)\r\n  }\r\n};\r\n```\r\nThe problem with that is it creates a new even listener `forEach` user.\r\nwe tried breaking out the event listener into a `filterView` file but it doesn't work, presumably because it's attached to content that hasn't finished being created\r\n\r\nThe question is how to either get it to generate only once / make it work in this other view. Callbacks? Promises? Crushed Dreams?"}}