Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit e842b22

Browse files
committed
feat(news): implement news comment function
1 parent adf59e0 commit e842b22

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/resources/features/data-list/data-list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {BindingEngine, bindable, bindingMode, customElement, containerless, inje
99
`)
1010
@inject(BindingEngine)
1111
export class DataListElement {
12-
@bindable({defaultBindingMode: bindingMode.twoWay}) data = [];
12+
@bindable({defaultBindingMode: bindingMode.twoWay}) data;
1313
@bindable({defaultBindingMode: bindingMode.twoWay}) model;
1414
@bindable controller;
1515

src/view-models/news/view.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const ENTER_KEY = 13;
99

1010
@inject(NewsService, NewsCommentsService, AuthService, NotificationService)
1111
export class View {
12+
comments = [];
13+
1214
constructor(newsService, newsCommentsService, authService, notificationService) {
1315
this.newsService = newsService;
1416
this.newsCommentsService = newsCommentsService;

src/views/news/view.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ <h4><a href="#/news/view/${news.id}">${news.title}</a></h4>
3636
</div>
3737
</div>
3838

39-
<data-list controller.bind="dataListController" data.bind="data" model.bind="model">
39+
<data-list controller.bind="dataListController" data.bind="comments" model.bind="model">
4040
<div class="aurelia-animators au-stagger">
41-
<div class="news-card-comment au-animate" repeat.for="item of data">
41+
<div class="news-card-comment au-animate" repeat.for="item of comments">
4242
<a href="#/profiles/view/${item.user.id}" class="pull-left">
4343
<!-- Todo -->
4444
<img alt="${item.user.username}" src="http://lr.local/img/avatar/${item.user.avatar}">

0 commit comments

Comments
 (0)