Skip to content

Commit

Permalink
Add basic display of triple count
Browse files Browse the repository at this point in the history
  • Loading branch information
peternowee committed Aug 4, 2023
1 parent dabb247 commit 4eb4c86
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
11 changes: 10 additions & 1 deletion app/routes/count.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import Route from '@ember/routing/route';
import fetch from 'fetch';

export default class CountRoute extends Route {}
export default class CountRoute extends Route {

async model() {
let response = await fetch('/count');
let json = await response.json();
return json.results.bindings[0]["callret-0"]["value"];
}

}
3 changes: 2 additions & 1 deletion app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<LinkTo @route="people">People</LinkTo>
<LinkTo @route="individual-products">Individual products</LinkTo>
<LinkTo @route="transactions">Transactions</LinkTo>
<LinkTo @route="count">Triple count</LinkTo>
</nav>

{{outlet}}
{{outlet}}
7 changes: 5 additions & 2 deletions app/templates/count.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
{{page-title "Count"}}
{{outlet}}
{{page-title "Triple count"}}

<p>Triple count: {{@model}}</p>

{{outlet}}

0 comments on commit 4eb4c86

Please sign in to comment.