node.js - Express.get is getting variable name instead of it's value from AngularJS ui-router -
as mention in title, when send param url using ui-router, , try use express.get(url), :param name instead of it's value. here code: angularjs ui-router state: .state('post', { url: '/blog/:postid', templateurl: 'app/views/post.html', controller: 'postctrl' }) angularjs http request $http.get('/blog/:postid').success(function(data) { console.log(data); $scope.singlepost = data; }).catch(function(error) { console.log(err); }); html ui-router url <h1><a ui-sref="post({ postid: post._id })">{{ post.title }}</a></h1> express.get() method app.get('/blog/:id', function(req, res) { post.findbyid(req.params.id, function(err, singlepost){ console.log(singlepost); if (err) { console.log(err); } else { res.json(singlepost); } }); }); i following error in console { [casterror: cast objectid failed ...