Homework 4 #9

Merged
merged 6 commits into from Dec 21, 2018

Conversation

Projects
None yet
2 participants
@norbs
Contributor

norbs commented Dec 15, 2018

No description provided.

@norbs

This comment has been minimized.

Contributor

norbs commented Dec 15, 2018

Note for later Sasha, I'd be interested to know a bit about best practices or even just for this example, how you'd think about the adding of each of the question items. My object oriented mindset makes me want to figure out how to create a reusable variable somewhere that I can "clone", fill in and then append each time, rather than the big long set of operations to create a brand new from scratch list item and all its children every time.

@vodnik

This comment has been minimized.

Owner

vodnik commented Dec 21, 2018

I like that you're thinking about best practices on this. Ryan. We're going to be covering template literals on the Tuesday after break, which would enable you to create the type of components you're describing. Short and sweet writeup with code examples.

@vodnik

vodnik approved these changes Dec 21, 2018

Nicely done, Ryan!

let outputTarget = $('#xForY');

//Click event on create button that outputs your new startup
$('#create').click(function() {

This comment has been minimized.

@vodnik

vodnik Dec 21, 2018

Owner

Nice work creating concise, reusable code.

//Chained methods to append necessary children elements and their props
surveyList.append($('<li>').addClass('form-group padout')
.append($('<label>').text(inputQuestion.val()))
.append($('<input>').attr('type', 'text').addClass('form-control'))

This comment has been minimized.

@vodnik

vodnik Dec 21, 2018

Owner

I appreciate the extra work you went through to research the type attribute here.

@vodnik vodnik merged commit 87a3580 into vodnik:master Dec 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment