---
title: "Comment by NgocThai on \"Beautifully encapsulate table related logic using a custom data source + sorting using directives\" | Hashnode"
description: "I found your article very good, however there is a small problem, when I use method updateData() in ngOnInit(){this.userSource.updateData([{name: &#39;1&#39;, e"
url: "https://hashnode.com/posts/implement-custom-data-source-sorting-angular/609633121ea29f2c341dfbc1/comment/61ee7f6fe247b2151e61bfcc"
---

[Discussion](https://hashnode.com/posts/implement-custom-data-source-sorting-angular/609633121ea29f2c341dfbc1)

Comment [Beautifully encapsulate table related logic using a custom data source + sorting using directives](https://hashnode.com/posts/implement-custom-data-source-sorting-angular/609633121ea29f2c341dfbc1)

[NgocThai](https://hashnode.com/@ngThai)

[Jan 24, 2022](https://hashnode.com/posts/implement-custom-data-source-sorting-angular/609633121ea29f2c341dfbc1/comment/61ee7f6fe247b2151e61bfcc)

I found your article very good, however there is a small problem, when I use method updateData() in ngOnInit(){this.userSource.updateData(\[{name: '1', email: '2', birthday : '3'}\]);} data table won't work

[Adithya Sreyaj](https://hashnode.com/@adisreyaj)

[Jan 24, 2022](https://hashnode.com/posts/implement-custom-data-source-sorting-angular/609633121ea29f2c341dfbc1/comment/61ee7f6fe247b2151e61bfcc#reply-61eec3fee247b2151e61cae5)

Glad you found it useful. I think the issue is because in the Datasource updateData method, we are not calling: this.inititalDataSubject.next(res); when the data passed is not an observable.
