Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wave 1 - First View ✅
Have a QuoteView class extended from Backbone.View (in src/app/views/quote_view.js).
The QuoteView should:
Have an initialize function that should:
Receive and store a JavaScript object with quote data (symbol and price). See Example Stocks for inspiration.✅
Compile an Underscore template using the script named tmpl-quote-view (which is already defined in index.html).✅
Have a render function that should:
Use the compiled template to render HTML for a single quote, using the quote data stored by initialize.✅
Wave 2 - Second View
In this wave we will create a second Backbone view, ApplicationView, which is responsible for displaying our entire web application. It will manage a list of QuoteView instances and render each of them. In order to achieve this your application should:
Primary Requirements:
Have an ApplicationView class extended from Backbone.View (in src/app/views/application_view.js).✅
The ApplicationView should:
Have an initialize function that should:✅
Receive and store a list of quote data objects.✅
Compile the same Underscore template from Wave 1. This compiled template will replace the one used in QuoteView during Wave 1.✅
Create and store a list of at least two QuoteView instances. Each instance should be given:
The data for a single quote.✅
The compiled Underscore template from the above step.✅
Store the HTML unordered list element from index.html that will contain the list of rendered quotes.✅
Have a render function that should:
Render each QuoteView instance in the list created within initialize.✅
Use the stored HTML unordered list element.✅
Append to that element the jQuery object for each QuoteView instance we rendered.
Wave 3 - Events✅
In this wave we will extend our QuoteView class to support clicking on the Buy and Sell buttons for each quote. In order to achieve this your application should be updated so that:
Primary Requirements
The QuoteView class should:
Have an events property that defines two handlers for the click event, one for each button in the quote template.✅
Have a function that runs when the click event happens on the buy button. This function should:
Increase the stock's price by a fixed amount (say, $1.00).✅
Re-render the view so that the new price is displayed to the user. ✅
Have a function that runs when the click event happens on the sell button. This function should:
Decrease the stocks' price by a fixed amount (say, $1.00).✅
Re-render the view so that the new price is displayed to the user. ✅
@PilgrimMemoirs: I relied heavily on comparing what we did in our live backbone code. I also asked lots of questions of my classmates. As I had to leave early for doctors appointment. Things are working but I'm not sure I would be able to repeat process without looking back at past projects. Also, I failed to have as many commit messages, as I typically use.