Monday, May 1, 2017

First look at Angular Material 2 Data Table

For anyone working with Angular 2, there's a number of options out there in the data table space, but noticeably lacking has been support for one in the Material 2 project.  If you're looking for good support of material styling, there's only a few options that I've found:

1. MDL - just a styled MDL table, or angularized version.
2. ngx-datatable
3. ng2-md-datatable

These are decent options depending on your needs, but if you've been wanting official version, we've been out of luck till now.  It looks like we finally are getting close to release DataTable in Material 2. Work has been visibly in progress for a while (and people have been begging for it!) over at the official tracking issue here: https://github.com/angular/material2/issues/581

Right now it's still sitting in a fork of the official repo, but I took opportunity to pull the base files out to take a look and get it running in a simple project.

So...for anyone who wants to play with the data table in the context of an Angular CLI based project, I kind of shoehorned the files from the branch into a minimal CLI project, and put the table on the AppComponent page. You can add it to any CLI project by basically following setup done in this base project.

Code is here: https://kmkatsma.github.io/md-table-cli-demo/

Running demo is here: https://kmkatsma.github.io/md-table-cli-demo/

One thing I can't figure out is how to get the headers to show without loading data in the table.  But overall, it seems to be pretty good approach.  I like that it just uses css for sizing and formatting, seems like that's good way to not have to build it into the api of the grid itself.  In any case, excited to finally get a chance to see the work being done!


5 comments:

  1. This is a very informative overview of the early development of the Angular Material 2 Data Table and the challenges developers faced while waiting for an official Material Design solution. The comparison with existing alternatives and the walkthrough of setting up the preview implementation provide practical guidance for developers who want to experiment with new Angular features before their official release. The article offers valuable insights into the evolution of Angular's UI ecosystem.

    ReplyDelete
  2. The discussion about integrating the Angular Material 2 Data Table into an Angular CLI project highlights the importance of understanding modern component libraries, responsive UI design, and reusable frontend architecture. Developers interested in building enterprise-ready applications can enhance their practical knowledge through Angular Projects, which cover component-based development, Material Design integration, and scalable application development using Angular.

    ReplyDelete
  3. It's also encouraging to see the focus on CSS-based sizing and formatting, which keeps the table API lightweight while allowing greater flexibility in UI customization. Exploring these implementation techniques alongside Web Development Projects helps developers strengthen their skills in creating responsive interfaces, reusable components, and maintainable frontend applications using modern web technologies.

    ReplyDelete
  4. The article's discussion of Angular Material 2 Data Table provides a useful example of how Angular developers can work with structured data presentation components. It compares several table options and describes an early implementation of the Material 2 DataTable within an Angular CLI project. Developers exploring Angular application development can also refer to Angular Training in Chennai for broader Angular concepts.

    ReplyDelete
  5. The article focuses on the author's experimentation with the developing Material 2 DataTable rather than presenting a finalized production component. The table was integrated into a simple Angular CLI project so that its behavior could be examined in a practical application. This type of project also involves TypeScript-based Angular development, making TypeScript Training in Chennai relevant to developers working with Angular source code.

    ReplyDelete