{"action":"closed","issue":{"url":"https://api.github.com/repos/Promact/md2/issues/48","repository_url":"https://api.github.com/repos/Promact/md2","labels_url":"https://api.github.com/repos/Promact/md2/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/Promact/md2/issues/48/comments","events_url":"https://api.github.com/repos/Promact/md2/issues/48/events","html_url":"https://github.com/Promact/md2/issues/48","id":197586633,"number":48,"title":"Not close custom dialog When I have click on submit button(Submit form).","user":{"login":"smartHasmukh","id":8941195,"avatar_url":"https://avatars.githubusercontent.com/u/8941195?v=3","gravatar_id":"","url":"https://api.github.com/users/smartHasmukh","html_url":"https://github.com/smartHasmukh","followers_url":"https://api.github.com/users/smartHasmukh/followers","following_url":"https://api.github.com/users/smartHasmukh/following{/other_user}","gists_url":"https://api.github.com/users/smartHasmukh/gists{/gist_id}","starred_url":"https://api.github.com/users/smartHasmukh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartHasmukh/subscriptions","organizations_url":"https://api.github.com/users/smartHasmukh/orgs","repos_url":"https://api.github.com/users/smartHasmukh/repos","events_url":"https://api.github.com/users/smartHasmukh/events{/privacy}","received_events_url":"https://api.github.com/users/smartHasmukh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-26T13:11:23Z","updated_at":"2016-12-28T05:41:29Z","closed_at":"2016-12-28T05:41:29Z","body":"I have submit form on submit button click. but I have use custom function like `saveArea(areaForm.value,areaForm.valid)`. and In `typescript` file in function has `if..else` condition.`if` form submitted successfully submit and `else` doesn't want to close dialog and error message display..\r\n\r\nI want to close dialog In `IF`. so please help. I have through `MD2` documents but I cant found that.\r\n\r\nI know about some methods of dialog\r\nIn `.ts` file \r\n `show(dialog: any) { dialog.show(); }`\r\n`close(dialog: any) { dialog.close(); }`\r\n\r\nbut it's not working it. I thought some custom methods.\r\n\r\n========  HTML code  =======\r\n\r\n```\r\n<md2-dialog #newArea title=\"Create a new area\">\r\n   <form [formGroup]=\"areaForm\" novalidate (ngSubmit)=\"saveArea(areaForm.value,areaForm.valid)\">\r\n        <div class=\"col-md-12\">\r\n           <md-input formControlName=\"name\" class=\"form-control\" type=\"text\" placeholder=\"Enter area name\"></md-input>\r\n        </div>\r\n        <div class=\"clearfix\"></div>\r\n        <md2-dialog-footer>\r\n            <button button type=\"button\" (click)=\"newArea.close()\" [ngClass]=\"'modal-cancel-btn'\">Cancel</button>\r\n           <button button [ngClass]=\"'modal-save-btn'\">Create</button>\r\n        </md2-dialog-footer>\r\n    </form>\r\n</md2-dialog>\r\n```\r\n\r\n======= typescript code ========\r\n\r\n```\r\nsaveArea(value: any, isFormValid: boolean) {`\r\n    console.log(value);\r\n    this.isFormSubmitted = true;\r\n    this.isFormInvalid = isFormValid;\r\n    if (isFormValid) {\r\n      if (this.selectedArea == null) {\r\n        this.donationAreaManagementService.addArea(value).subscribe(result => {\r\n          this.initialize()\r\n        })\r\n      } else {\r\n        let body = {\r\n          \"name\": value.name,\r\n\r\n        }\r\n        this.donationAreaManagementService.editArea(this.selectedArea.areaId, body).subscribe(result => {\r\n          this.initialize()\r\n        })\r\n      }\r\n    }\r\n  }\r\n\r\n```  \r\n\r\n\r\n![dialog png 1366x768](https://cloud.githubusercontent.com/assets/8941195/21482564/9ca593f8-cb9b-11e6-8ce0-b123ef73f41b.png)\r\n\r\n"}}
{"actor":{"display_login":"dharmeshpipariya"}}