{"action":"created","issue":{"url":"https://api.github.com/repos/mbenford/ngTagsInput/issues/463","labels_url":"https://api.github.com/repos/mbenford/ngTagsInput/issues/463/labels{/name}","comments_url":"https://api.github.com/repos/mbenford/ngTagsInput/issues/463/comments","events_url":"https://api.github.com/repos/mbenford/ngTagsInput/issues/463/events","html_url":"https://github.com/mbenford/ngTagsInput/issues/463","id":76924970,"number":463,"title":"Can `on-tag-adding` accept a promise?","user":{"login":"ggundersen","id":2818208,"avatar_url":"https://avatars.githubusercontent.com/u/2818208?v=3","gravatar_id":"","url":"https://api.github.com/users/ggundersen","html_url":"https://github.com/ggundersen","followers_url":"https://api.github.com/users/ggundersen/followers","following_url":"https://api.github.com/users/ggundersen/following{/other_user}","gists_url":"https://api.github.com/users/ggundersen/gists{/gist_id}","starred_url":"https://api.github.com/users/ggundersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggundersen/subscriptions","organizations_url":"https://api.github.com/users/ggundersen/orgs","repos_url":"https://api.github.com/users/ggundersen/repos","events_url":"https://api.github.com/users/ggundersen/events{/privacy}","received_events_url":"https://api.github.com/users/ggundersen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mbenford/ngTagsInput/labels/status:%20replied","name":"status: replied","color":"9A2EFE"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-16T02:36:51Z","updated_at":"2016-01-28T06:39:27Z","closed_at":null,"body":"When the user selects the first tag in my autocomplete dictionary—it has the property `newField: true`—, I'd like to open a modal box and then either accept the new tag or reject it, depending on whether or not the user clicks \"ok\" or \"cancel\" in the modal box. So something like this:\r\n\r\n```\r\nscope.addNew = function(newTag) {\r\n    if (!newTag.newField) {\r\n        return true;\r\n    }\r\n    return $q(function(resolve, reject) {\r\n        $modal.open({\r\n            templateUrl: 'releases/addModal/addModal.html',\r\n            controller: function($scope, $modalInstance) {\r\n                $scope.ok = function() {\r\n                    newTag.text = $scope.newText.text;\r\n                    newTag.newField = false;\r\n                    $modalInstance.close();\r\n                    resolve(true);\r\n                };\r\n                $scope.cancel = function() {\r\n                    $modalInstance.dismiss('cancel');\r\n                    reject(false);\r\n                };\r\n            }\r\n        });\r\n    });\r\n}\r\n```\r\nIs this kind of functionality possible? If not, it seems like something nice to have."},"comment":{"url":"https://api.github.com/repos/mbenford/ngTagsInput/issues/comments/176011625","html_url":"https://github.com/mbenford/ngTagsInput/issues/463#issuecomment-176011625","issue_url":"https://api.github.com/repos/mbenford/ngTagsInput/issues/463","id":176011625,"user":{"login":"mrdivyansh","id":8512339,"avatar_url":"https://avatars.githubusercontent.com/u/8512339?v=3","gravatar_id":"","url":"https://api.github.com/users/mrdivyansh","html_url":"https://github.com/mrdivyansh","followers_url":"https://api.github.com/users/mrdivyansh/followers","following_url":"https://api.github.com/users/mrdivyansh/following{/other_user}","gists_url":"https://api.github.com/users/mrdivyansh/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdivyansh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdivyansh/subscriptions","organizations_url":"https://api.github.com/users/mrdivyansh/orgs","repos_url":"https://api.github.com/users/mrdivyansh/repos","events_url":"https://api.github.com/users/mrdivyansh/events{/privacy}","received_events_url":"https://api.github.com/users/mrdivyansh/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T06:39:27Z","updated_at":"2016-01-28T06:39:27Z","body":"+1"}}