{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/dialog/issues/200","repository_url":"https://api.github.com/repos/aurelia/dialog","labels_url":"https://api.github.com/repos/aurelia/dialog/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/dialog/issues/200/comments","events_url":"https://api.github.com/repos/aurelia/dialog/issues/200/events","html_url":"https://github.com/aurelia/dialog/issues/200","id":168309442,"number":200,"title":"DialogController.ok() or DialogController.cancel(); the modal does not close when calling from non-view model","user":{"login":"m-andrew-albright","id":4950445,"avatar_url":"https://avatars.githubusercontent.com/u/4950445?v=3","gravatar_id":"","url":"https://api.github.com/users/m-andrew-albright","html_url":"https://github.com/m-andrew-albright","followers_url":"https://api.github.com/users/m-andrew-albright/followers","following_url":"https://api.github.com/users/m-andrew-albright/following{/other_user}","gists_url":"https://api.github.com/users/m-andrew-albright/gists{/gist_id}","starred_url":"https://api.github.com/users/m-andrew-albright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-andrew-albright/subscriptions","organizations_url":"https://api.github.com/users/m-andrew-albright/orgs","repos_url":"https://api.github.com/users/m-andrew-albright/repos","events_url":"https://api.github.com/users/m-andrew-albright/events{/privacy}","received_events_url":"https://api.github.com/users/m-andrew-albright/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-29T11:58:15Z","updated_at":"2016-08-24T01:23:21Z","closed_at":null,"body":"<!--\r\nBUGS: Please use this template.\r\n-->\r\n**I'm submitting a bug report**\r\n\r\n* **Library Version:**\r\n1.0.0-beta.2.0.0\r\n\r\n**Please tell us about your environment:**\r\n* **Operating System:**\r\nWindows 10\r\n\r\n* **Node Version:**\r\n6.2.2\r\n\r\n* **NPM Version:**\r\n3.9.5\r\n\r\n* **JSPM OR Webpack AND Version**\r\nJSPM 0.16.39\r\n\r\n* **Browser:**\r\nChrome 51.0.2704.103 | Firefox 47.0 | Edge 25.10586.0.0\r\n* **Language:**\r\nESNext\r\n\r\n\r\n**Current behavior:**\r\n\r\nWe had decided to wrap the usage of aurelia-dialog in an abstracted layer so that switching modals out later would only require one place to change any code out.  This mostly works, but calling `this.dialogController.ok()` or `this.dialogController.cancel()` results in the following error (stack trace is from this.dialogController.cancel() specifically):\r\n\r\n```\r\nlifecycle.js:10 Uncaught TypeError: Cannot read property 'canDeactivate' of undefined\r\n    invokeLifecycle @ lifecycle.js:10\r\n    close @ dialog-controller.js:46\r\n    cancel @ dialog-controller.js:27\r\n    cancel @ modal-controller.js:17\r\n    cancelButtonClick @ add-user.js:42\r\n    evaluate @ aurelia-binding.js:1570\r\n    callSource @ aurelia-binding.js:4997\r\n    (anonymous function) @ aurelia-binding.js:5021\r\n    handleDelegatedEvent @ aurelia-binding.js:3210\r\n```\r\n\r\n**Expected/desired behavior:**\r\n<!--\r\nIf the current behavior is a bug, please provide the steps to reproduce and, if possible, a minimal demo of the\r\nproblem along with a runnable gist, if possible.\r\nTo create a runnable gist, go to https://gist.run/?id=7542e061bc940cde506b&sha=6821c521a6c7bae6f59a36fb8628ecd1032b2d10\r\nThen click \"Fork to Public Gist\".\r\nCreate your gist, then finally click \"Update Gist.\" Include a link to the gist.run below.\r\n-->\r\n\r\n\r\n* **What is the expected behavior?**\r\n\r\nThe expected behavior is that the modal should not throw an error, and it should close.\r\n\r\n* **What is the motivation / use case for changing the behavior?**\r\n\r\nSo that it works when wrapping the dialog-controller and dialog-service in an abstraction layer for ease of changing modal/dialog providers in the future."},"comment":{"url":"https://api.github.com/repos/aurelia/dialog/issues/comments/241931524","html_url":"https://github.com/aurelia/dialog/issues/200#issuecomment-241931524","issue_url":"https://api.github.com/repos/aurelia/dialog/issues/200","id":241931524,"user":{"login":"PWKad","id":4238393,"avatar_url":"https://avatars.githubusercontent.com/u/4238393?v=3","gravatar_id":"","url":"https://api.github.com/users/PWKad","html_url":"https://github.com/PWKad","followers_url":"https://api.github.com/users/PWKad/followers","following_url":"https://api.github.com/users/PWKad/following{/other_user}","gists_url":"https://api.github.com/users/PWKad/gists{/gist_id}","starred_url":"https://api.github.com/users/PWKad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PWKad/subscriptions","organizations_url":"https://api.github.com/users/PWKad/orgs","repos_url":"https://api.github.com/users/PWKad/repos","events_url":"https://api.github.com/users/PWKad/events{/privacy}","received_events_url":"https://api.github.com/users/PWKad/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T01:23:21Z","updated_at":"2016-08-24T01:23:21Z","body":"I'll be digging in to Dialog issues tonight to reproduce, thanks for the sample, and I'll report back here."}}
{"actor":{"display_login":"PWKad"}}