At the end of this class, you will be able to:
this (lesson 15)wilson-espina/jsd-9-resources repo to your computerDocuments/JSD/jsd-9-resources/16-crud-firebasethisthis refers to the object that the function is executing in.| SITUATION | WHAT this MAPS TO |
|---|---|
| 1. method invocation | the object that owns the method |
| 2. constructor function | the newly created object |
| 3. event handler | the element that the event was fired from |
| 4. function invocation | the global object ( |
| 5. function invocation (strict mode) |
|
| 6. arrow function | the context of the caller |
Open up: 00-this-codealong
Key Objective
Type of Exercise
Location
starter-code > 01-this-exerciseTiming
6 mins |
|
| SITUATION | HTTP VERB | OPERATION |
|---|---|---|
| Create | POST | Create a new resource |
| Read | GET | Read a resource |
| Update | PUT/PATCH | Update a resource |
| Delete | DELETE | Delete a resource |
Stores HTML/CSS/JS code
Stores database
Google Cloud Services including:
| CRUD Action | HTTP VERB | FIREBASE METHOD |
|---|---|---|
| Create | POST |
|
| Read | GET |
|
| Update | PUT |
|
| Update | PATCH |
|
| Delete | DELETE |
|
CLEAN UP
Open up: starter-code
#message input.push() Firebase method to create a new record.
CREATE
<ul class="message-board">
<li>Apples in Hackney</li>
<li>Oranges in Brixton</li>
<li>Cheese in Ladbroke Grove</li>
</ul>
data ATTRIBUTEAllows us to associate meta data with DOM elements
data- plus any string
<article
id="dogs"
data-coloumns="6"
data-index-name="Spot"
data-parent="pets">
Lorem ipsum
</article>
data-id ATTRIBUTES
getPosts function..on('value') method.messages array.
READ
Key Objective
Type of Exercise
Timing
20mins |
|
Key Objective
Type of Exercise
Timing
10mins |
|
(Lesson #16)