How to post information from a form to mongodb with angularjs

0

I'm doing a project with YOMAN ANGULAR-FULLSTACK (angularjs + node + mongodb) and I need to upload data from a form to a database. The problem is that so far I can upload empty content, but I do not know how I should do to load the fields I fill in the form ... (I can see all the elements and delete them, but not upload a new one from the form) This is my .pug

form(name='edit', novalidate='')
 .form-group
   label  Name
   br
   input.form-control(type='text', ng-model='name.curso', name='name', id='name' required='')
button.btn.btn-primary(type='submit', ng-click='newitemCtrl.submit()') Save

and this is my component:

submit() {
 this.$http.post('/api/mazmorras/');
}

export default angular.module('bomApp.newitem', [uiRouter])
.config(routes)
.component('newitem', {
template: require('./newitem.pug'),
controller: NewitemComponent,
controllerAs: 'newitemCtrl'
})

.name;

And this is the result of what I see when I hit the save button

Could someone give me some guidance on how to proceed, please? Thank you so much! :)

    
asked by Pil 13.02.2018 в 15:11
source

0 answers