Code Monkey home page Code Monkey logo

Comments (6)

DavideViolante avatar DavideViolante commented on May 8, 2024

That's strange, did you edit some lines of my code? I can update the cats without any issue. What version of MongoDB and Node you have? Did you create the "cats" database by yourself (it should be created automatically) or you add any index? Does you receive any error in browser console too (F12 in Chrome)? Check also the "Network" tab (I'm using Chrome: F12 -> Network) while you edit the cat and tell me what you see there. There should be a successful PUT request (the edit) with the new data.

from angular-full-stack.

developerJordy avatar developerJordy commented on May 8, 2024

I was making changes in the code, but now the problem persists after pulling fresh copy's of the repo without code changes. I have not created any databases myself.
I get no console errors and the network call status is 'pending' when I click save after updating.

$ mongod --version
db version v2.4.9

node -v
v6.0.0

I'm starting to suspect that this is an outdated mongo problem.

from angular-full-stack.

DavideViolante avatar DavideViolante commented on May 8, 2024

I think you are right, please update MongoDB (I've 3.2.8) and let me know if it persists. Also note that I didn't test it with Node 6.x, I've 4.4.7.

from angular-full-stack.

developerJordy avatar developerJordy commented on May 8, 2024

I have updated mongoDB to 3.2.8 and updating records works again, thanks !

If I may make a suggestion for the app it'd be:

  • maybe an auth functionaility (jwt tokens?) for securing the routes with canActivate
  • and an api (secured) for safe data calls to th server

Thanks for the help and for sharing the project. I like its simplicity , ideal for learning MEAN with angular2. Now I'll try to replace mongoDB with mongo lab.

from angular-full-stack.

DavideViolante avatar DavideViolante commented on May 8, 2024

Good!
About the suggestions:

  • authentication is not a simple task and can be accomplished in multiple ways. I want to keep the project very simple. I don't know if I will add it in future (maybe in a separate project with Angular 2 final). Btw JWT is a good way to do it.
  • do you mean secured api calls so that only authorized users can call /api/xxx? If so, yes it should be implemented because now everyone can call update and delete api calls and this is not really cool...

About mLab I think you just need to edit line 18 of server.js, so that you can use a remote mongo database.

from angular-full-stack.

developerJordy avatar developerJordy commented on May 8, 2024

It might indeed be better to wait for the final Angular 2 release and make it a seperate project, and for the API I mean indeed that only authorized users can make calls so it relies on the authentication.

And thanks for the mlab tip !

from angular-full-stack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.