{"action":"opened","issue":{"url":"https://api.github.com/repos/vesparny/angular-fancy-modal/issues/9","labels_url":"https://api.github.com/repos/vesparny/angular-fancy-modal/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/vesparny/angular-fancy-modal/issues/9/comments","events_url":"https://api.github.com/repos/vesparny/angular-fancy-modal/issues/9/events","html_url":"https://github.com/vesparny/angular-fancy-modal/issues/9","id":82550186,"number":9,"title":"scope with controllerAs","user":{"login":"jmls","id":929523,"avatar_url":"https://avatars.githubusercontent.com/u/929523?v=3","gravatar_id":"","url":"https://api.github.com/users/jmls","html_url":"https://github.com/jmls","followers_url":"https://api.github.com/users/jmls/followers","following_url":"https://api.github.com/users/jmls/following{/other_user}","gists_url":"https://api.github.com/users/jmls/gists{/gist_id}","starred_url":"https://api.github.com/users/jmls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmls/subscriptions","organizations_url":"https://api.github.com/users/jmls/orgs","repos_url":"https://api.github.com/users/jmls/repos","events_url":"https://api.github.com/users/jmls/events{/privacy}","received_events_url":"https://api.github.com/users/jmls/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-29T19:17:07Z","updated_at":"2015-05-29T19:17:07Z","closed_at":null,"body":"if both of my controllers (parent and modal) are using controllerAs syntax , as in\r\n\r\nmain controller:\r\n\r\n```javascript\r\n    angular.module('myApp').controller('mainCtrl', mainCtrl)\r\n    mainCtrl.$inject = ['$stateParams','$state''$fancyModal']\r\n\r\n    function mainCtrl($stateParams,$state$fancyModal) {\r\n       var controller = this;\r\n\r\n       [snip]\r\n       controller.data = {foo: \"bar\"}\r\n\r\n       $fancyModal.open({\r\n                templateUrl: '/myTemplate',\r\n                controller: 'modalCtrl as controller'\r\n            });\r\n    })\r\n```\r\nmodal controller:\r\n\r\n```javascript\r\n\r\nangular.module('myApp')\r\n    .controller('modalCtrl', modalCtrl)\r\n\r\nfunction modalCtrl() {\r\n    var controller = this;\r\n\r\n   // how do I get data from mainCtrl in here ?\r\n}\r\n```\r\n\r\nhow can I pass data from mainCtrl into the modalCtrl ? $scope is not used at all .. can I pass a data object in ? What's the best practice in this instance ?\r\n\r\nMany thanks\r\n\r\n"}}