- [Instructor] Now it's time to create articles.…We'll create an API endpoint…as well as a method for communicating with it…in our article service file.…So now let's go to our server folder…and hit up our api.js file,…and this time we'll put in router instead of get.…This is a post request.…The endpoint will be /create.…
We'll console.log posting an article,…create a variable of newArticle,…and we reference it,…newArticle.title property equals the request body title,…also newArticle.content property…equals the request body content,…and then newArticle, we'll use the save method,…pass in an error and response is article,…and if there's an error, we console.log…error inserting the article.…
Also we have an extra parenthesis up there,…and then else,…we'll put the response of json and pass in an article.…Additionally we have to add a parentheses…and colon right here, and we're good to go.…So this time, just so we don't forget,…let's restart our node server as we've changed the API file.…So we'll run node server.…
All right.…
Author
Released
10/16/2017- Angular Firebase CRUD
- Firebase setup
- Starting a project
- Defining the template
- CRUD apps with MongoDB
- MongoDB setup
- Creating a data service
- Home component
- Creating, updating, and deleting articles
Skill Level Intermediate
Duration
Views
Related Courses
-
Angular Testing and Debugging
with Derek Peruo1h 16m Intermediate
-
Introduction
-
Introduction57s
-
Exercise files41s
-
-
1. Required Understanding
-
Using the Angular CLI3m 28s
-
Capturing user events2m 37s
-
Displaying data3m 31s
-
Angular router4m 30s
-
-
2. Angular Firebase CRUD
-
Firebase setup1m 58s
-
Starting the project3m 34s
-
Defining the template6m 49s
-
Defining the CSS5m 24s
-
Create and read4m 59s
-
Updating6m 33s
-
-
3. CRUD Apps with MongoDB (Back End)
-
Starting the project5m 17s
-
MongoDB setup2m 41s
-
Setting up the API6m 56s
-
-
4. CRUD Apps with MongoDB (Front End)
-
Creating the data service2m 30s
-
Displaying the articles5m 22s
-
Home component6m 9s
-
Article component7m 19s
-
Creating articles8m 13s
-
Article form6m 25s
-
Updating articles7m 54s
-
Deleting articles2m 37s
-
-
Conclusion
-
Next steps22s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Creating articles