{"action":"created","issue":{"url":"https://api.github.com/repos/yukatan/commangular/issues/14","labels_url":"https://api.github.com/repos/yukatan/commangular/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/yukatan/commangular/issues/14/comments","events_url":"https://api.github.com/repos/yukatan/commangular/issues/14/events","html_url":"https://github.com/yukatan/commangular/issues/14","id":107656621,"number":14,"title":"Is it possible to have optional command parameter?","user":{"login":"tstankevicius","id":9268579,"avatar_url":"https://avatars.githubusercontent.com/u/9268579?v=3","gravatar_id":"","url":"https://api.github.com/users/tstankevicius","html_url":"https://github.com/tstankevicius","followers_url":"https://api.github.com/users/tstankevicius/followers","following_url":"https://api.github.com/users/tstankevicius/following{/other_user}","gists_url":"https://api.github.com/users/tstankevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/tstankevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tstankevicius/subscriptions","organizations_url":"https://api.github.com/users/tstankevicius/orgs","repos_url":"https://api.github.com/users/tstankevicius/repos","events_url":"https://api.github.com/users/tstankevicius/events{/privacy}","received_events_url":"https://api.github.com/users/tstankevicius/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-22T06:57:55Z","updated_at":"2015-10-05T08:53:49Z","closed_at":null,"body":"Currently if you want to use a parameter in the command passed into the event you have to inject it and it cannot be undefined.\r\nWe would like to have optional parameter and if it's not passed give it a default value instead.\r\nIs that possible?\r\n\r\nAnd one more question. Aspects have possibility to exchange data with each other using processor. Would it be possible to do the same for commands?\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/yukatan/commangular/issues/comments/145466685","html_url":"https://github.com/yukatan/commangular/issues/14#issuecomment-145466685","issue_url":"https://api.github.com/repos/yukatan/commangular/issues/14","id":145466685,"user":{"login":"yukatan","id":5052935,"avatar_url":"https://avatars.githubusercontent.com/u/5052935?v=3","gravatar_id":"","url":"https://api.github.com/users/yukatan","html_url":"https://github.com/yukatan","followers_url":"https://api.github.com/users/yukatan/followers","following_url":"https://api.github.com/users/yukatan/following{/other_user}","gists_url":"https://api.github.com/users/yukatan/gists{/gist_id}","starred_url":"https://api.github.com/users/yukatan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yukatan/subscriptions","organizations_url":"https://api.github.com/users/yukatan/orgs","repos_url":"https://api.github.com/users/yukatan/repos","events_url":"https://api.github.com/users/yukatan/events{/privacy}","received_events_url":"https://api.github.com/users/yukatan/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T08:53:49Z","updated_at":"2015-10-05T08:53:49Z","body":"At the moment, you can dispatch an event with a data object in it, so you really don't need to inject the data. There is not feature that allow you to have a optional parameter, but I'm not sure if that is really needed.\r\n\r\nTo share data between commands in a group or flow you can use de commandModel. It is and object that exits during the command livecycle and can be injected on every command. You can see and example here : [https://github.com/yukatan/commangular/blob/master/test/groups/command-model-test.js](https://github.com/yukatan/commangular/blob/master/test/groups/command-model-test.js)"}}