{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/Discussion/issues/273","labels_url":"https://api.github.com/repos/vuejs/Discussion/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/Discussion/issues/273/comments","events_url":"https://api.github.com/repos/vuejs/Discussion/issues/273/events","html_url":"https://github.com/vuejs/Discussion/issues/273","id":95083954,"number":273,"title":"wait-for directive and events not making sense","user":{"login":"jakeryansmith","id":6209794,"avatar_url":"https://avatars.githubusercontent.com/u/6209794?v=3","gravatar_id":"","url":"https://api.github.com/users/jakeryansmith","html_url":"https://github.com/jakeryansmith","followers_url":"https://api.github.com/users/jakeryansmith/followers","following_url":"https://api.github.com/users/jakeryansmith/following{/other_user}","gists_url":"https://api.github.com/users/jakeryansmith/gists{/gist_id}","starred_url":"https://api.github.com/users/jakeryansmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakeryansmith/subscriptions","organizations_url":"https://api.github.com/users/jakeryansmith/orgs","repos_url":"https://api.github.com/users/jakeryansmith/repos","events_url":"https://api.github.com/users/jakeryansmith/events{/privacy}","received_events_url":"https://api.github.com/users/jakeryansmith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-15T01:51:24Z","updated_at":"2015-07-15T13:43:48Z","closed_at":null,"body":"Ok so I've been at this for the last 2 hours and I can't figure it out. I'm trying to postpone the rendering of a component using the 'wait-for' directive. I've tired every possible thing I can think of. Could someone maybe give an example of how this works? Thanks!"},"comment":{"url":"https://api.github.com/repos/vuejs/Discussion/issues/comments/121621076","html_url":"https://github.com/vuejs/Discussion/issues/273#issuecomment-121621076","issue_url":"https://api.github.com/repos/vuejs/Discussion/issues/273","id":121621076,"user":{"login":"jakeryansmith","id":6209794,"avatar_url":"https://avatars.githubusercontent.com/u/6209794?v=3","gravatar_id":"","url":"https://api.github.com/users/jakeryansmith","html_url":"https://github.com/jakeryansmith","followers_url":"https://api.github.com/users/jakeryansmith/followers","following_url":"https://api.github.com/users/jakeryansmith/following{/other_user}","gists_url":"https://api.github.com/users/jakeryansmith/gists{/gist_id}","starred_url":"https://api.github.com/users/jakeryansmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakeryansmith/subscriptions","organizations_url":"https://api.github.com/users/jakeryansmith/orgs","repos_url":"https://api.github.com/users/jakeryansmith/repos","events_url":"https://api.github.com/users/jakeryansmith/events{/privacy}","received_events_url":"https://api.github.com/users/jakeryansmith/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T13:43:48Z","updated_at":"2015-07-15T13:43:48Z","body":"Your code worked, which has helped clarify what the real issue might be. It looks like the\r\n```\r\nthis.$emit('data-loaded');\r\n```\r\n\r\nonly works if it's inside a function? If I do this:\r\n```\r\ncompiled: function () {\r\n        this.$emit('data-loaded');\r\n    },\r\n```\r\nIt does not work; however, placing it inside a function like you did:\r\n```\r\ncompiled: function () {\r\n        // Some long task, maybe XHR?\r\n        //setTimeout(function() {\r\n        this.$emit('data-loaded');\r\n        //}.bind(this), 2000);\r\n    },\r\n```\r\n\r\nworks just fine. So going back to the original problem I had: I'm trying to use the vue-resource plugin to pull in data from an API and I want to emit the event when it's finished:\r\n\r\n```\r\nthis.$http.get(url)\r\n   .success(function (data, status, request) {\r\n      this.product = data;\r\n      this.$emit('data-loaded');\r\n})\r\n```\r\nBut this does not work for some reason.\r\n\r\nI hope that makes sense. Any ideas? Thanks!"}}