{"action":"created","issue":{"url":"https://api.github.com/repos/dustinspecker/generator-ng-poly/issues/160","labels_url":"https://api.github.com/repos/dustinspecker/generator-ng-poly/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/dustinspecker/generator-ng-poly/issues/160/comments","events_url":"https://api.github.com/repos/dustinspecker/generator-ng-poly/issues/160/events","html_url":"https://github.com/dustinspecker/generator-ng-poly/issues/160","id":73345885,"number":160,"title":"Decorators generator","user":{"login":"jakubikan","id":174327,"avatar_url":"https://avatars.githubusercontent.com/u/174327?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubikan","html_url":"https://github.com/jakubikan","followers_url":"https://api.github.com/users/jakubikan/followers","following_url":"https://api.github.com/users/jakubikan/following{/other_user}","gists_url":"https://api.github.com/users/jakubikan/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubikan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubikan/subscriptions","organizations_url":"https://api.github.com/users/jakubikan/orgs","repos_url":"https://api.github.com/users/jakubikan/repos","events_url":"https://api.github.com/users/jakubikan/events{/privacy}","received_events_url":"https://api.github.com/users/jakubikan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dustinspecker/generator-ng-poly/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-05T15:27:30Z","updated_at":"2015-05-16T11:10:25Z","closed_at":"2015-05-14T23:27:20Z","body":"Hey Dustin, \r\n\r\nI stumbled upon decorators today, what about to support them as generator? I think they are pretty useful if you want to add functionality to a library without forking it. I had to extend the $select Service of ngstrap. \r\n\r\nMy example:\r\n```coffeescript\r\nclass SelectDecorator\r\n  constructor: ($provide)->\r\n    $provide.decorator '$select', ($delegate)->\r\n      $select = (element, controller, config)->\r\n        del = $delegate(element, controller, config)\r\n        del.$scope.$selectSeveral = (event, indices)->\r\n          for i in indices\r\n            del.$scope.$select i.index, event\r\n        del.$scope.$isActiveServeral = (indices)->\r\n          active = false\r\n          for i in indices\r\n            active |= del.$scope.$isActive i.index\r\n          active\r\n        del\r\n\r\n\r\n      $select.defaults =\r\n        animation: 'am-fade',\r\n        prefixClass: 'select',\r\n        prefixEvent: '$select',\r\n        placement: 'bottom-left',\r\n        template: 'select/select.tpl.html',\r\n        trigger: 'focus',\r\n        container: false,\r\n        keyboard: true,\r\n        html: false,\r\n        delay: 0,\r\n        multiple: false,\r\n        allNoneButtons: false,\r\n        sort: true,\r\n        caretHtml: '&nbsp;<span class=\"caret\"></span>',\r\n        placeholder: 'Choose among the following...',\r\n        allText: 'All',\r\n        noneText: 'None',\r\n        maxLength: 3,\r\n        maxLengthHtml: 'selected',\r\n        iconCheckmark: 'glyphicon glyphicon-ok'\r\n\r\n      $select\r\nangular\r\n  .module('xxx')\r\n  .config ['$provide', SelectDecorator]\r\n```\r\n\r\nGreetz\r\n\r\nJack"},"comment":{"url":"https://api.github.com/repos/dustinspecker/generator-ng-poly/issues/comments/102609490","html_url":"https://github.com/dustinspecker/generator-ng-poly/issues/160#issuecomment-102609490","issue_url":"https://api.github.com/repos/dustinspecker/generator-ng-poly/issues/160","id":102609490,"user":{"login":"jakubikan","id":174327,"avatar_url":"https://avatars.githubusercontent.com/u/174327?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubikan","html_url":"https://github.com/jakubikan","followers_url":"https://api.github.com/users/jakubikan/followers","following_url":"https://api.github.com/users/jakubikan/following{/other_user}","gists_url":"https://api.github.com/users/jakubikan/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubikan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubikan/subscriptions","organizations_url":"https://api.github.com/users/jakubikan/orgs","repos_url":"https://api.github.com/users/jakubikan/repos","events_url":"https://api.github.com/users/jakubikan/events{/privacy}","received_events_url":"https://api.github.com/users/jakubikan/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T11:10:25Z","updated_at":"2015-05-16T11:10:25Z","body":"nice, thank you :)"}}