Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Node.js
- router.get('/users/all', authenticate, (req, res) => {
- User.find({some query}).select('firstName lastName email').then((users) => {
- res.send(users);
- });
- //Angular Service
- return this.http.get(getUserDataUrl, opts)
- .pipe(
- map(response => {
- // here is the problem
- console.log(response.json());
- return response.json()
- }),
- catchError(this.handleErrors)
- );
- // Node.js
- router.get('/users/all', authenticate, (req, res) => {
- User.findOne({some query}).select('firstName lastName email').then((user) => {
- res.send(user); // there was a typo I changed it too. look in the question not user it was users.
- });
Add Comment
Please, Sign In to add comment