Instructions:
- fork
- run
json-server --watch db.json
- run
open solution.html
- click around in the app, click on the animals, create a new one, update an animal
- after understanding the features of this app, try to recreate this app
- use the empty index.html file and index.js file to recreate from scratch
- check out solution.html and solution.js
- hot tip: when adding an image for a new animal, right click and "copy image URL" from an image you'd like to use, and make sure the image size isn't too big
Objectives:
- understand how to slap something small on the DOM
- iterate to slap multiple things on the dom
- try working with static data from an array first (such as an array of animals)
- work with events
- make our data bigger: slap divs on the dom from objects
- move to fetching from our db.json
- understand promises in more detail
- understand when to use headers
- understand optimistic/pessimistic rendering
-CRUD: -be able to read things from api/db on the DOM -be able to create a new thing and send it to api/db and to dom -be able to update and delete -modularize and refactor code
Fun little tidbits:
- when to use += and = with innerHTML
- try your hand at async await
- check out ES6 destructuring
- use the very useful name attribute in forms
- understand when to use headers
- use ES6 object property value shorthand
- work with dataset id's, and understand how to query select using using data-id