This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
</head> | |
<body> | |
<form id="target" action="destination.html"> | |
<input type="text" value="Hello there"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"es6": true, | |
"node": true | |
}, | |
"plugins": [ | |
"mocha" | |
], | |
"parserOptions": { | |
"sourceType": "module" |
Prettier: https://github.com/Thinkful-Ed/curric-node-001-v5/pull/544
Mongoose: https://github.com/Thinkful-Ed/curric-node-001-v5/pull/532
For discussion:
Edits to feature/tests
A Pen by Chris Tsongas on CodePen.
A Pen by Chris Tsongas on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from 'redux'; | |
import reduxThunk from 'redux-thunk'; | |
import reducers from './reducers'; | |
const store = createStore(reducers, | |
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), | |
applyMiddleware(reduxThunk)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function loginUser(employeeId, password) { | |
return function(dispatch) { | |
axios.post(`${ROOT_URL}/authenticate`, { employeeId, password }) | |
.then(response => { | |
dispatch({ type: AUTH_USER }); | |
localStorage.setItem('id', response.data.id); | |
localStorage.setItem('token', response.data.token); | |
browserHistory.push('/home'); | |
}) | |
.catch(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setlist.count({}, (err, count) => { | |
let promise; | |
// if db is empty, create a setlist | |
if (count === 0) { | |
promise = Setlist.create({ | |
tracks: [req.body.track] | |
}); | |
} else { | |
// add track to setlist | |
promise = Setlist.findOneAndUpdate({}, |
Don't worry you're definitely not the first person to be confused by this type of problem! Before doing alert(prizes[btnNum])
try alerting just btnNum
by itself and see if that gives you a clue as to what's going on.
To solve this problem, remember you can pass the click event to the function that handles it like this:
function(e) {
// do something
};
NewerOlder