I'm trying to get data from my MongoDB displayed in my HTML page. Is it possible to get this done by Angular or do I need a templating engine for this? I'm using Express on Node platform.
I've already managed to get my POST done with Angular.
Here is my server call to MongoDB:
router.get('/getdata', function(req, res, next){
UserData.find()
.then(function(doc){
console.log('Data successfully retrieved');
res.render('index', {items: doc});
});
});
Now only my index page is a template(Jade). The rest of my pages are routed with Angular and are regular HTML pages. I thought there was a way to display MongoDB data with Angular in HTML using these quotes {{}}, but I dont't know how this works
I would suggest you to create API in node.js which will directly connect to Mongodb, and then use that API in AngularJS to bind the data in HTML. You can check Using AngularJS with MongoDB