0

I have just started with mean.js and am confused about its work flow. I created a new module using yo man generator. I need to be clarified about

  • How a record is been added to the database ie where are the queries.
  • How can a record be updated
I'm nidhin
  • 2,592
  • 6
  • 36
  • 62

1 Answers1

0

All CRUD functions are located inside public/modules/yourModule/controllers you can see yourModule.client.controller.js.

Inside you can see the functions $scope.create, $scope.remove, $scope.update, $scope.find, $scope.findOne.

These functions are called in your view public/modules/yourModule/views.

Inside you can see four files for your CRUD operations create-yourModule.client.view.html, edit-yourModule.client.view.html, list-yourModule.client.view.html, view-yourModule.client.view.html.

For eg: in create-yourModule.client.view.html on form you can see <form class="form-horizontal" data-ng-submit="create()"> the create() function is called.

If you want to see the mongoose model schema app/models/yourModule.server.model.js

For more details watch this good tutorial here, (watch video 9 to 15)

Hareesh
  • 6,770
  • 4
  • 33
  • 60
  • Thank you. My doubt is, when $scope.create is triggered in client side, which function in the server controller is been invoked ? and where are the mongo actions happening ? – I'm nidhin Mar 26 '15 at 05:10
  • check `app/controllers/yourModule.server.controller.js`. – Hareesh Mar 26 '15 at 14:37