Comments (7)
From brief purely code read I can only identify the following:
The "hidden" field isn't actually hidden. In HTML hidden form fields have a type="hidden" rather than what you've put.
The "id" that you're logging out in onCommentVoteUpSubmit() doesn't exist in the given context, so will be undefined. What I think you wanted to log was this.newComment._id.
I hope this helps
from gettingmean-2.
What you said was what I did from the onset. i.e. this.newComment._id
but it keeps returning error when compiled. It always complain that _id
is not set in Comment class while it is set.
The problem is that am unable access any of the Comment field in the method
That is why I thought of doing it another way
P.s. am now able to get rid of the error, but still unable to pass the id from the form to the onCommentVoteUpSubmit()
from gettingmean-2.
from gettingmean-2.
why are you trying to set this data at the template level
From the onset, I thought the comment id is available in the component level but when I use this.comment._id
, it returns
Undefined
I thought, it I could get it that way. I tried this.post.comments._id
, it also returned
Undefined
That is why I chose the part of template component.
If this is actually a brand new comment (which I suspect)
This is not a brand new comment. USER A makes a comment, USER B, after reading the comment, click on the LIKE button to like the comment.
_I suspect that sending data with an already assigned id field will cause the original comment to be overwritten - maybe this is what you’re shooting for, maybe it isn’t.
No, that is not am aiming for.
Are you trying to add voting to comments that are already submitted and display in the page as a list?
Yes, that is my goal.
In which case, why are you using a newComment class to hold that data?
Reason why I did that is not far fetched, I simply wanted to use the newComment
for creating (1) a new comment (2) updating an existing comment (3) using it in voting system.
This is what am trying to achieve.
Am sorry for incessant messages. That is due to a newbie trying to get to the professional level
from gettingmean-2.
from gettingmean-2.
I have message you.
Thanks so much
from gettingmean-2.
I've replied. I'm going to close this now.
from gettingmean-2.
Related Issues (11)
- Can't find code of illustratioin in github HOT 2
- NODE_ENV if statement in section 5.5.3 not in chapter-05 branch HOT 10
- Creating a new request HOT 12
- Heroku: no option! What to use HOT 1
- Chapter 8: connection to local MongoDB failed? data not shown in app
- Not able to run application in Docker HOT 4
- main.f1591746b38f1c40b495.js:1 Uncaught Error: No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document. HOT 1
- Cannot find http://localhost:3000/build/runtime.ec2944dd8b20ec099bf3.js net::ERR_ABORTED 404 (Not Found) HOT 11
- TypeError when calling the API into renderHomepage() HOT 1
- "$geoNear no longer supports the 'limit' parameter. Use a $limit stage instead." HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gettingmean-2.