Skip to content
Snippets Groups Projects
Commit 04cbbdb9 authored by Eugen Ciur's avatar Eugen Ciur
Browse files

emberjs - the frontend framework of choice!

parent decc12ab
No related branches found
No related tags found
No related merge requests found
# papermerge
# PapermergeJS
This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.
......@@ -14,8 +14,8 @@ You will need the following things properly installed on your computer.
## Installation
* `git clone <repository-url>` this repository
* `cd papermerge`
* `git clone git@github.com:papermerge/papermerge.js.git` this repository
* `cd papermerge.js`
* `npm install`
## Running / Development
......
<h2>{{@title}}</h2>
<ul>
{{#each @document as |doc|}}
<li>
<button type="button" {{on 'click' (fn this.showDocument doc)}}>{{doc}}</button>
</li>
{{/each}}
</ul>
\ No newline at end of file
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class DocumentsListComponent extends Component {
@action
showDocument(doc) {
alert(`The person's name is ${doc}!`);
}
}
\ No newline at end of file
......@@ -6,4 +6,6 @@ export default class Router extends EmberRouter {
rootURL = config.rootURL;
}
Router.map(function () {});
Router.map(function () {
this.route('documents');
});
import Route from '@ember/routing/route';
export default class DocumentsRoute extends Route {
model() {
return ['Marie Curie', 'Mae Jemison', 'Albert Hofmann'];
}
}
{{page-title "Papermerge"}}
{{!-- The following component displays Ember's default welcome message. --}}
<WelcomePage />
{{!-- Feel free to remove this! --}}
<h1>People Tracker</h1>
{{outlet}}
\ No newline at end of file
{{page-title "Documents"}}
<DocumentsList
@title="List of Documents"
@document={{@model}}
/>
\ No newline at end of file
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | documents-list', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<DocumentsList />`);
assert.dom(this.element).hasText('');
// Template block usage:
await render(hbs`
<DocumentsList>
template block text
</DocumentsList>
`);
assert.dom(this.element).hasText('template block text');
});
});
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | documents', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup('route:documents');
assert.ok(route);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment