Skip to content

Commit

Permalink
- Adding 8 +9 to menu
Browse files Browse the repository at this point in the history
- New Image (2 new exercises)
- A little bit more line breaks in the problem.md files
- 0.3.0 => npm publish
  • Loading branch information
mdunisch committed Sep 25, 2014
1 parent c201e39 commit e6a4c94
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
9 changes: 5 additions & 4 deletions exercises/8_start_templating/problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Let's do a little bit of templating!
* * *
## Lead the Way ##
For this mission, let me show you the `template` function.
_template() gives you access to simple and powerfull micro-templating with Lo-Dash.
_template() gives you access to simple and powerfull micro-templating
with Lo-Dash.

```js
_.template(text, data)
Expand All @@ -31,9 +32,9 @@ a simple var for us:
login: [ 1407574431, 140753421 ]
}
```
We want a simple string greeting the user by name and showing the number of times
the user has logged in (every timestamp represents one login). Your
function should return a String like this:
We want a simple string greeting the user by name and showing the
number of times the user has logged in (every timestamp represents
one login). Your function should return a String like this:

```
Hello Foo (logins: 2)
Expand Down
13 changes: 7 additions & 6 deletions exercises/9_todo_template/problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ the same as `<? ?>`.
```js
var mytemplate = '<% _.forEach(data, function(item){ %>' +
'<li><%= item %></li>' +
'<% }); %>';
'<% }); %>';
_.template(mytemplate, {data: [1, 2, 3]});

/*
Expand All @@ -28,8 +28,8 @@ Javascript. Isn't that awesome?

As a third parameter, `template()` accepts a options object. One of
the options I really like and want to show you is `option.imports`.
With `options.imports`, you can define an object to describe values to import into the
template as local variables.
With `options.imports`, you can define an object to describe values
to import into the template as local variables.

#### Example ####
```js
Expand All @@ -38,7 +38,8 @@ var ucfirst = function (str) {
return f + str.substr(1);
};

_.template('Hello <%= ucfirst(foo) %>', {foo: "mike"}, { 'imports': { 'ucfirst': ucfirst } });
_.template('Hello <%= ucfirst(foo) %>', {foo: "mike"},
{ 'imports': { 'ucfirst': ucfirst } });
// Hello Mike
```

Expand Down Expand Up @@ -74,8 +75,8 @@ We have a JSON of different to-do's:
]
}
```
We want to create a simple nested `<ul><li>` list of all the to-do items.
But, in addition to creating HTML code, we want you to:
We want to create a simple nested `<ul><li>` list of all the
to-do items. But, in addition to creating HTML code, we want you to:
- Sort the to-do items by date (from earliest to latest)
- Add a "<b>URGENT</b>" to every `<li>` when the date is only 2 days or fewer from today.

Expand Down
4 changes: 3 additions & 1 deletion exercises/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"4: Everyone Is Min",
"5: Count the Comments",
"6: Give Me an Overview",
"7: Analyze"
"7: Analyze",
"8: Start templating",
"9: ToDo Template"
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lololodash",
"version": "0.2.1",
"version": "0.3.0",
"description": "A Set of Lo-Dash Javascript Exercises",
"main": "lololodash.js",
"repository": {
Expand Down
Binary file modified screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e6a4c94

Please sign in to comment.