{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5683","repository_url":"https://api.github.com/repos/angular-ui/bootstrap","labels_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5683/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5683/comments","events_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5683/events","html_url":"https://github.com/angular-ui/bootstrap/issues/5683","id":142948776,"number":5683,"title":"`$modal.open` compatibility with component (`angular.component` method)","user":{"login":"zdychacek","id":2000174,"avatar_url":"https://avatars.githubusercontent.com/u/2000174?v=3","gravatar_id":"","url":"https://api.github.com/users/zdychacek","html_url":"https://github.com/zdychacek","followers_url":"https://api.github.com/users/zdychacek/followers","following_url":"https://api.github.com/users/zdychacek/following{/other_user}","gists_url":"https://api.github.com/users/zdychacek/gists{/gist_id}","starred_url":"https://api.github.com/users/zdychacek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdychacek/subscriptions","organizations_url":"https://api.github.com/users/zdychacek/orgs","repos_url":"https://api.github.com/users/zdychacek/repos","events_url":"https://api.github.com/users/zdychacek/events{/privacy}","received_events_url":"https://api.github.com/users/zdychacek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/AngularJS%201.5","name":"AngularJS 1.5","color":"eb9904"},{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/component:%20modal","name":"component: modal","color":"ffffff"},{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/type:%20discussion","name":"type: discussion","color":"c7def8"},{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/type:%20enhancement","name":"type: enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-03-23T12:37:09Z","updated_at":"2016-04-11T15:46:25Z","closed_at":null,"body":"Hello,\r\n\r\nI want to ask if you're considering support of `angular.component` method which is new API for creating components.\r\n\r\nI'd like to have the ability to call `$modal.open` method with the component definition. Now I have to specify `controller` and `template` options...\r\n\r\n**My API proposal:**\r\n\r\n```\r\nangular.module('myApp').component('myModal', {\r\n  bindings: {\r\n    greeting: '<'\r\n  },\r\n  template: '<div>{{$ctrl.greeting}}</div>',\r\n  controller: function () {},\r\n})\r\n\r\n// open the modal\r\n$modal.open({\r\n  component: 'myModal',\r\n  bindings: {\r\n    greeting: 'hello',\r\n  },\r\n});\r\n```\r\n\r\nThanks for response.\r\n\r\nO."},"comment":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/comments/208410043","html_url":"https://github.com/angular-ui/bootstrap/issues/5683#issuecomment-208410043","issue_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5683","id":208410043,"user":{"login":"zdychacek","id":2000174,"avatar_url":"https://avatars.githubusercontent.com/u/2000174?v=3","gravatar_id":"","url":"https://api.github.com/users/zdychacek","html_url":"https://github.com/zdychacek","followers_url":"https://api.github.com/users/zdychacek/followers","following_url":"https://api.github.com/users/zdychacek/following{/other_user}","gists_url":"https://api.github.com/users/zdychacek/gists{/gist_id}","starred_url":"https://api.github.com/users/zdychacek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdychacek/subscriptions","organizations_url":"https://api.github.com/users/zdychacek/orgs","repos_url":"https://api.github.com/users/zdychacek/repos","events_url":"https://api.github.com/users/zdychacek/events{/privacy}","received_events_url":"https://api.github.com/users/zdychacek/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T15:46:25Z","updated_at":"2016-04-11T15:46:25Z","body":"@dfsq Hi, I would like to know, how do you access `$modaInstance` service from within the component's controller?\r\n\r\nI can't see any other solution than passing it explicitly via component's `bindings` from the controller.\r\n\r\n```\r\n$modal.open({\r\n  template: '<my-modal greeting=\"$ctrl.greeting\" modal-instance=\"$ctrl.modalInstance\"></my-modal>',\r\n  controller: [ '$modalInstance', function ($modalInstance) {\r\n    this.greeting = 'hello';\r\n    this.modalInstance = $modalInstance;\r\n  } ],\r\n  controllerAs: '$ctrl',\r\n});\r\n```"}}