Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Load nodes into front page
Browse files Browse the repository at this point in the history
Use NotesApi in App to load notes into front page
Show all loaded notes in the front page
  • Loading branch information
vuorinem committed Nov 19, 2016
1 parent 3d2b066 commit b7b64cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
16 changes: 3 additions & 13 deletions src/app.html
Expand Up @@ -7,21 +7,11 @@
<navbar></navbar>

<div class="container">
<div class="jumbotron">
<h1>
<h1>${message}</h1>
</h1>
</div>
<h1>Notes</h1>

<div class="row">
<div class="col-md-4">
<note></note>
</div>
<div class="col-md-4">
<note></note>
</div>
<div class="col-md-4">
<note></note>
<div class="col-md-4" repeat.for="note of notes">
<note content.bind="note.content"></note>
</div>
</div>
</div>
Expand Down
16 changes: 15 additions & 1 deletion src/app.ts
@@ -1,3 +1,17 @@
import { autoinject } from 'aurelia-framework';
import { NotesApi } from './api/notes-api';

@autoinject
export class App {
message = 'Hello World!';

private notes: Array<string> = [];

constructor(private notesApi: NotesApi) {
}

private attached() {
this.notesApi.getNotes()
.then(notes => this.notes.push(...notes));
}

}

0 comments on commit b7b64cd

Please sign in to comment.