新しいアイテムを作成または編集するときに同じように不可欠なフォームの繰り返しテンプレート コードを避けようとしています。
たとえば、次のようなものです。
<template name="createOrEdit">
<form role="form">
<div class="form-group">
<input type="text" class="form-control" id="title" placeholder="Title"/ value="{{title}}">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</template>
<template name="create">
{{> createOrEdit}}
</template>
<template name="edit">
{{> createOrEdit}}
</template>
次に、個別のテンプレート ハンドラーを作成できます。
Template.create.events(...
Template.edit.events(...
ただし、これらの親テンプレート ラッパーは、メインの子テンプレートのイベントを取得しません。
私がやりたいことをする方法はありますか?