angular not conencting to mongoose angular not conencting to mongoose mongoose mongoose

angular not conencting to mongoose


var mongoose = require('mongoose');

This line should be outside your controller i.e. just below or above use strict


Your html code is having a backward dependency. Using require('mongoose') in the online webpage(html code) won't work. For this either you can use browserify or require.js to eliminate these dependencies.They will let you link your <script> js file to require.js(generated automatically) and the code will work fine.Visit http://requirejs.org/ if you didn't understand it. It is clearly explained there.