Created
November 13, 2012 20:55
-
-
Save bnadlerjr/4068336 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| --- | |
| title: Welcome to Middleman | |
| --- | |
| %h1 Dashboard | |
| %h2 Net Income | |
| %table | |
| %caption Net Income Over Time | |
| %thead | |
| %th Month Ending | |
| %th Income | |
| %th Expenses | |
| %th Net Income | |
| %tfoot | |
| %tr | |
| %td Totals | |
| %tbody(data-bind="foreach: rows") | |
| %tr | |
| %td(data-bind="text: monthEnding") | |
| %td(data-bind="text: income") | |
| %td(data-bind="text: expenses") | |
| %td(data-bind="text: netIncome") |
This file contains hidden or 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
| // Overall view model for screen | |
| function NetIncomeViewModel() { | |
| var self = this; | |
| self.rows = ko.observableArray([]); | |
| $.getJSON('/api/net_income', function(data) { | |
| self.rows(data); | |
| }); | |
| } | |
| ko.applyBindings(new NetIncomeViewModel()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment