{"action":"closed","issue":{"url":"https://api.github.com/repos/dwmkerr/angular-modal-service/issues/14","labels_url":"https://api.github.com/repos/dwmkerr/angular-modal-service/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/dwmkerr/angular-modal-service/issues/14/comments","events_url":"https://api.github.com/repos/dwmkerr/angular-modal-service/issues/14/events","html_url":"https://github.com/dwmkerr/angular-modal-service/issues/14","id":47512918,"number":14,"title":"modal() is undefined and modal template is appended to body","user":{"login":"contrastlogic","id":970283,"avatar_url":"https://avatars.githubusercontent.com/u/970283?v=3","gravatar_id":"","url":"https://api.github.com/users/contrastlogic","html_url":"https://github.com/contrastlogic","followers_url":"https://api.github.com/users/contrastlogic/followers","following_url":"https://api.github.com/users/contrastlogic/following{/other_user}","gists_url":"https://api.github.com/users/contrastlogic/gists{/gist_id}","starred_url":"https://api.github.com/users/contrastlogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contrastlogic/subscriptions","organizations_url":"https://api.github.com/users/contrastlogic/orgs","repos_url":"https://api.github.com/users/contrastlogic/repos","events_url":"https://api.github.com/users/contrastlogic/events{/privacy}","received_events_url":"https://api.github.com/users/contrastlogic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-11-01T18:25:18Z","updated_at":"2015-03-20T21:38:52Z","closed_at":"2015-03-20T21:38:52Z","body":"Code is entered exactly as the example and when the `showAModal()` function fires the modal template html is appended to the body while the console outputs this:\r\n\r\n`TypeError: undefined is not a function`which points to this line `modal.element.modal();`\r\n\r\nUsing Angular 1.3.0\r\nAny insight is appreciated.\r\n\r\nCode in the controller\r\n\r\n```javascript\r\n\r\n\t\t\t$scope.showAModal = function () {\r\n\t\t\t\tModalService.showModal({\r\n\t\t\t\t\ttemplateUrl: 'partials/cancel-membership.modal.html',\r\n\t\t\t\t\tcontroller: 'ModalCtrl'\r\n\t\t\t\t}).then(function (modal) {\r\n\r\n\t\t\t\t\t//it's a bootstrap element, use 'modal' to show it\r\n\t\t\t\t\tmodal.element.modal();\r\n\t\t\t\t\tmodal.close.then(function (result) {\r\n\t\t\t\t\t\tconsole.log(result);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t};\r\n```"}}