addressListItem 이벤트 전체 코드는 다음과 같다.
~/Projects/addressBook/client/addressList.js
...생략... Template.addressListItem.events({ 'click button[name=remove]' (evt,tmpl){ AddressBook.remove( { _id : this._id } ); } , 'click button[name=modify]' (evt,tmpl){ Session.set("editItem",this._id); } , /* 수정 모드에서 저장 버튼 구현 */ 'click button[name=save]' (evt,tmpl){ var address = { name : tmpl.find("input[name=name]").value ,phone : tmpl.find("input[name=phone]").value ,email : tmpl.find("input[name=email]").value ,company : tmpl.find("input[name=company]").value ,birthday : tmpl.find("input[name=birthday]").value }; AddressBook.update({_id:this._id},{$set:address}); Session.set("editItem",null); } , /* 수정 모드에서 취소 버튼 구현 */ 'click button[name=cancel]' (evt,tmpl){ Session.set("editItem",null); } , /* 뷰 모드에서 텍스트 버튼 클릭 시 수정 모드로 전환 */ 'click .edit-thing' (evt,tmpl){ Session.set("editItem",this._id); } }); ...생략...