Join Gary Simon for an in-depth discussion in this video Creating articles, part of Angular 2+: Creating CRUD Apps.
- [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.…
- 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
Angular 2: Widget-Based Architectureswith Derek Peruo52m 18s Intermediate
Angular 2 Essential Trainingwith Justin Schwartzenberger2h 45m Intermediate
1. Required Understanding
2. Angular Firebase CRUD
3. CRUD Apps with MongoDB (Back End)
4. CRUD Apps with MongoDB (Front End)
- 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.Cancel
Take 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.