In my last
post I showed how to getting start with a meteor application. In this post I will show how to submit a form in a meteor application.
First we will create a meteor application called SchoolApp.
Create following folders inside of
SchoolApp folder. You can delete all files which was created by default.
Inside
client folder create
home.html and add following content. Then run meteor application and you will see output like below.
For front end design we will use
bootstrap. Add bootstrap using following command.
In the
client folder create a folder called
templates and inside that add
createStudent.html file. It's content should be like below.
Include
studentCreate template in
home.html file like below. You will see the form like below.
When an user save a student, we must save that student into our database. Create
collections.js file in
both folder and add
students collection into that. All the students will save into this collection.
Add
studentCreate.js file into templates folder and add content like below. Then save a student from browser.
Go to application folder using command prompt and enter following commands. You will see the data that you have inserted,
Now add
studentList.html file like below.
Add
studentList.js file like below.
Add
studentList into
home.html file and you will see browser output like below.
Download source code from
github.