{"action":"closed","issue":{"url":"https://api.github.com/repos/angular-ui/ui-select/issues/1597","repository_url":"https://api.github.com/repos/angular-ui/ui-select","labels_url":"https://api.github.com/repos/angular-ui/ui-select/issues/1597/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-select/issues/1597/comments","events_url":"https://api.github.com/repos/angular-ui/ui-select/issues/1597/events","html_url":"https://github.com/angular-ui/ui-select/issues/1597","id":153998280,"number":1597,"title":"TypeError: Cannot read property 'source' of undefined with custom templates","user":{"login":"katemihalikova","id":7225023,"avatar_url":"https://avatars.githubusercontent.com/u/7225023?v=3","gravatar_id":"","url":"https://api.github.com/users/katemihalikova","html_url":"https://github.com/katemihalikova","followers_url":"https://api.github.com/users/katemihalikova/followers","following_url":"https://api.github.com/users/katemihalikova/following{/other_user}","gists_url":"https://api.github.com/users/katemihalikova/gists{/gist_id}","starred_url":"https://api.github.com/users/katemihalikova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katemihalikova/subscriptions","organizations_url":"https://api.github.com/users/katemihalikova/orgs","repos_url":"https://api.github.com/users/katemihalikova/repos","events_url":"https://api.github.com/users/katemihalikova/events{/privacy}","received_events_url":"https://api.github.com/users/katemihalikova/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/ui-select/labels/type:%20bug","name":"type: bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-10T12:50:15Z","updated_at":"2016-05-16T12:12:14Z","closed_at":"2016-05-16T12:12:14Z","body":"### Bug description:\r\nWhen the ui-select is being rendered, error is shown in console:\r\n\r\n```javascript\r\nTypeError: Cannot read property 'source' of undefined\r\n    at Array.<anonymous> (select.js:1840)\r\n    at ngModelWatch (angular.js:26943)\r\n    at Scope.$digest (angular.js:17064)\r\n    at Scope.$apply (angular.js:17337)\r\n    at done (angular.js:11572)\r\n    at completeRequest (angular.js:11778)\r\n    at XMLHttpRequest.requestLoaded (angular.js:11711)\r\n```\r\n\r\nThis happens only when using custom templates that need to be fetched.\r\nSeems related to #1440.\r\n\r\n### Link to minimally-working plunker that reproduces the issue:\r\nhttp://plnkr.co/edit/Xk6lyhMoqWRAhDg7IK6h?p=preview\r\n\r\n### Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS\r\nAngular 1.5.5\r\nUI-Select 0.16.1\r\nAny CSS"}}