{"action":"created","issue":{"url":"https://api.github.com/repos/Siyfion/angular-typeahead/issues/77","repository_url":"https://api.github.com/repos/Siyfion/angular-typeahead","labels_url":"https://api.github.com/repos/Siyfion/angular-typeahead/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/Siyfion/angular-typeahead/issues/77/comments","events_url":"https://api.github.com/repos/Siyfion/angular-typeahead/issues/77/events","html_url":"https://github.com/Siyfion/angular-typeahead/issues/77","id":109211859,"number":77,"title":"When loading via a promise, bad error: \"  Error: d is undefined \" is given","user":{"login":"StuAtGit","id":9757762,"avatar_url":"https://avatars.githubusercontent.com/u/9757762?v=3","gravatar_id":"","url":"https://api.github.com/users/StuAtGit","html_url":"https://github.com/StuAtGit","followers_url":"https://api.github.com/users/StuAtGit/followers","following_url":"https://api.github.com/users/StuAtGit/following{/other_user}","gists_url":"https://api.github.com/users/StuAtGit/gists{/gist_id}","starred_url":"https://api.github.com/users/StuAtGit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuAtGit/subscriptions","organizations_url":"https://api.github.com/users/StuAtGit/orgs","repos_url":"https://api.github.com/users/StuAtGit/repos","events_url":"https://api.github.com/users/StuAtGit/events{/privacy}","received_events_url":"https://api.github.com/users/StuAtGit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-01T01:29:40Z","updated_at":"2016-02-28T10:12:46Z","closed_at":null,"body":"I pull my data out via a promise, and set up the typeahead in the promises callback like so:\r\n\r\n```\r\nvar callback = function( data ) {\r\n\t\tvar brandsBloodhound = new Bloodhound({\r\n\t\t\tdatumTokenizer : function(datum) { return Bloodhound.tokenizers.whitespace(datum.name);},\r\n\t\t\tqueryTokenizer : Bloodhound.tokenizers.whitespace,\r\n\t\t\tidentify: function(datum) { return datum.name; },\r\n\t\t\tlocal : data,\r\n\t\t\tinitialize : true\r\n\t\t});\r\n\t\t$scope.typeaheadData = {};\r\n\r\n\t\t$scope.typeaheadData.options = {\r\n\t\t\thighlight: true\r\n\t\t};\r\n\t\t$scope.typeaheadData.brandDataset = {\r\n\t\t\tdisplayKey : \"name\",\r\n\t\t\tsource : brandsBloodhound.ttAdapter()\r\n\t\t};\r\n\t\t$scope.typeaheadData.selected = data[0].name;\r\n\t};\r\n\r\n\t$myService.getData().then(\r\n\t\tfunction( data ) {\r\n\t\t\tloadBrands( data );\r\n\t\t},\r\n\t\tfunction( error ) {\r\n\t\t\t$scope.errorDisplay = error;\r\n\t\t}\r\n\t);\r\n```\r\n\r\n\r\nAnd you end up getting an error like:\r\n\r\n```\r\n18:25:48.842 Error: d is undefined\r\nattach/<@http://localhost:63342/video-reviewer-fe/bower_components/typeahead.js/dist/typeahead.bundle.js:2240:40\r\nreverseArgs@http://localhost:63342/video-reviewer-fe/bower_components/typeahead.js/dist/typeahead.bundle.js:968:28\r\n.each@http://localhost:63342/video-reviewer-fe/bower_components/jquery/dist/jquery.js:374:14\r\n_</<.each@http://localhost:63342/video-reviewer-fe/bower_components/typeahead.js/dist/typeahead.bundle.js:966:17\r\nattach@http://localhost:63342/video-reviewer-fe/bower_components/typeahead.js/dist/typeahead.bundle.js:2239:21\r\n.each@http://localhost:63342/video-reviewer-fe/bower_components/jquery/dist/jquery.js:374:14\r\njQuery.prototype.each@http://localhost:63342/video-reviewer-fe/bower_components/jquery/dist/jquery.js:139:10\r\ninitialize@http://localhost:63342/video-reviewer-fe/bower_components/typeahead.js/dist/typeahead.bundle.js:2236:1\r\n$.fn.typeahead@http://localhost:63342/video-reviewer-fe/bower_components/typeahead.js/dist/typeahead.bundle.js:2383:24\r\ninitialize@http://localhost:63342/video-reviewer-fe/bower_components/angular-typeahead/angular-typeahead.js:102:13\r\n.link@http://localhost:63342/video-reviewer-fe/bower_components/angular-typeahead/angular-typeahead.js:17:9\r\ncloneAndAnnotateFn/<@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:8774:41\r\ninvokeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:8780:9\r\nnodeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:8280:1\r\ncompositeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7671:13\r\ncompositeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7675:13\r\ncompositeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7675:13\r\ncompositeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7675:13\r\npublicLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7546:30\r\nngViewFillContentFactory/<.link@http://localhost:63342/video-reviewer-fe/bower_components/angular-route/angular-route.js:985:7\r\ninvokeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:8780:9\r\nnodeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:8280:1\r\ncompositeLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7671:13\r\npublicLinkFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7546:30\r\ncreateBoundTranscludeFn/boundTranscludeFn@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:7690:1\r\ncontrollersBoundTransclude@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:8307:18\r\nupdate@http://localhost:63342/video-reviewer-fe/bower_components/angular-route/angular-route.js:935:25\r\n$RootScopeProvider/this.$get</Scope.prototype.$broadcast@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:16244:15\r\ncommitRoute/<@http://localhost:63342/video-reviewer-fe/bower_components/angular-route/angular-route.js:619:15\r\nprocessQueue@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:14678:28\r\nscheduleProcessQueue/<@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:14694:27\r\n$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:15922:16\r\n$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:15733:15\r\n$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:16030:13\r\ndone@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:10545:36\r\ncompleteRequest@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:10717:7\r\nrequestLoaded@http://localhost:63342/video-reviewer-fe/bower_components/angular/angular.js:10658:1\r\n <input class=\"typeahead ng-pristine ng-untouched ng-valid ng-isolate-scope\" sf-typeahead=\"\" options=\"typeaheadData.options\" datasets=\"typeaheadData.brandDataset\" ng-model=\"typeaheadData.selected\" type=\"text\">1 angular.js:12450:18\r\nconsoleLog/<() angular.js:12450\r\n$ExceptionHandlerProvider/this.$get</<() angular.js:9237\r\ninvokeLinkFn() angular.js:8782\r\nnodeLinkFn() angular.js:8280\r\ncompositeLinkFn() angular.js:7671\r\ncompositeLinkFn() angular.js:7675\r\ncompositeLinkFn() angular.js:7675\r\ncompositeLinkFn() angular.js:7675\r\npublicLinkFn() angular.js:7546\r\nngViewFillContentFactory/<.link() angular-route.js:985\r\ninvokeLinkFn() angular.js:8780\r\nnodeLinkFn() angular.js:8280\r\ncompositeLinkFn() angular.js:7671\r\npublicLinkFn() angular.js:7546\r\ncreateBoundTranscludeFn/boundTranscludeFn() angular.js:7690\r\ncontrollersBoundTransclude() angular.js:8307\r\nupdate() angular-route.js:935\r\n$RootScopeProvider/this.$get</Scope.prototype.$broadcast() angular.js:16244\r\ncommitRoute/<() angular-route.js:619\r\nprocessQueue() angular.js:14678\r\nscheduleProcessQueue/<() angular.js:14694\r\n$RootScopeProvider/this.$get</Scope.prototype.$eval() angular.js:15922\r\n$RootScopeProvider/this.$get</Scope.prototype.$digest() angular.js:15733\r\n$RootScopeProvider/this.$get</Scope.prototype.$apply() angular.js:16030\r\ndone() angular.js:10545\r\ncompleteRequest() angular.js:10717\r\nrequestLoaded() angular.js:10658\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/Siyfion/angular-typeahead/issues/comments/189834754","html_url":"https://github.com/Siyfion/angular-typeahead/issues/77#issuecomment-189834754","issue_url":"https://api.github.com/repos/Siyfion/angular-typeahead/issues/77","id":189834754,"user":{"login":"RongBranovate","id":12894931,"avatar_url":"https://avatars.githubusercontent.com/u/12894931?v=3","gravatar_id":"","url":"https://api.github.com/users/RongBranovate","html_url":"https://github.com/RongBranovate","followers_url":"https://api.github.com/users/RongBranovate/followers","following_url":"https://api.github.com/users/RongBranovate/following{/other_user}","gists_url":"https://api.github.com/users/RongBranovate/gists{/gist_id}","starred_url":"https://api.github.com/users/RongBranovate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RongBranovate/subscriptions","organizations_url":"https://api.github.com/users/RongBranovate/orgs","repos_url":"https://api.github.com/users/RongBranovate/repos","events_url":"https://api.github.com/users/RongBranovate/events{/privacy}","received_events_url":"https://api.github.com/users/RongBranovate/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T10:12:46Z","updated_at":"2016-02-28T10:12:46Z","body":"I fixed the problem on my end, it endded being something not related so i removed to post, everything is working fine now, thanks"}}