Skip to content

Commit c6a5354

Browse files
committed
Cleanup your turn
1 parent 7c50532 commit c6a5354

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

days/093-096-vuejs/your-turn/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Here are a few steps and code concepts to help you on this journey.
2222

2323
To create the Vue.js app, you will create an instance passing the *settings* object. Do this in `js/site.js`.
2424

25-
```
25+
```javascript
2626
var app = new Vue({
2727
el: '#app',
2828
data: {
@@ -37,7 +37,7 @@ For this work, you'll need to set the id of the card block of HTML in `views/ind
3737

3838
To show data, you use the handlebar style, in HTML:
3939

40-
```
40+
```html
4141
<div>
4242
{{search_text}}
4343
</div>
@@ -47,7 +47,7 @@ To show data, you use the handlebar style, in HTML:
4747

4848
To bind bi-directionally, use the model on elements that can change (input, select, etc):
4949

50-
```
50+
```html
5151
<input type="text" v-model="search_text" />
5252
```
5353

@@ -57,7 +57,7 @@ Play around with this in your app to see that it's working.
5757

5858
To loop over data, use `v-for`, for example:
5959

60-
```
60+
```html
6161
<div class="movie" v-for="m in movies">
6262
</div>
6363
```
@@ -66,7 +66,7 @@ To loop over data, use `v-for`, for example:
6666

6767
For conditional rendering, it's `v-if` and `v-else:
6868

69-
```
69+
```html
7070
<span class="year" v-if="m.year > 0">{{m.year}}</span>
7171
<span class="year" v-else>NO YEAR</span>
7272
```
@@ -86,21 +86,21 @@ methods: {
8686

8787
### Hooking events
8888

89-
To hook events, use the @ directive on HTML elements. Here is an exampe:
89+
To hook events, use the @ directive on HTML elements. Here is an example:
9090

91-
```
91+
```html
9292
<input type="text" v-model="search_text" @keyup.enter="the_function()" />
9393
```
9494

9595
### Setting attributes
9696

97-
One final bit of code you'll need to make this app work is the ability to set attributes. To do that, you'll use `:attribute_name="binding_value"`. For exampe:
97+
One final bit of code you'll need to make this app work is the ability to set attributes. To do that, you'll use `:attribute_name="binding_value"`. For example:
9898

99-
```
99+
```html
100100
<option v-for="g in genres" :value="g">{{g}}</option>
101101
```
102102

103-
With all of this background info. Go ahead and write the app to work up to the point we had it with fake data. For that you'll need to create and include a fake_data.js file. Just save the data from the service.
103+
With all of this background info. Go ahead and write the app to work up to the point we had it with fake data. For that you'll need to create and include a `fake_data.js` file. Just save the data from the service.
104104

105105

106106
## Day 3: Watch videos second half
@@ -113,7 +113,9 @@ Down to the last day! Now you can toss that fake data and start using the API.
113113

114114
We will be using the [axios library](https://github.com/axios/axios). You can call any GET HTTP endpoint via something like this:
115115

116-
```
116+
```javascript
117+
// In js/site.js within a method of your app.
118+
117119
let that = this
118120
axios.get(url)
119121
.then(function (response) { // handle success
@@ -124,11 +126,11 @@ axios.get(url)
124126
})
125127
```
126128

127-
Remeber our service is located at [movie_service.talkpython.fm](http://movie_service.talkpython.fm/). Use this type of code above to implement three methods and bind those methods to the revelant events:
129+
Remember our service is located at [movie_service.talkpython.fm](http://movie_service.talkpython.fm/). Use this type of code above to implement three methods and bind those methods to the relevant events:
128130

129-
* search()
130-
* top_10()
131-
* load_genre(genre)
131+
* `search()`
132+
* `top_10()`
133+
* `load_genre(genre)`
132134

133135
Also use it to get the genres from the service.
134136

0 commit comments

Comments
 (0)