{"id":15366411,"url":"https://github.com/jasonboy/ly-table","last_synced_at":"2025-03-27T21:22:18.820Z","repository":{"id":143888210,"uuid":"48905972","full_name":"JasonBoy/ly-table","owner":"JasonBoy","description":"Simple Angular Table Directive","archived":false,"fork":false,"pushed_at":"2017-04-12T06:15:39.000Z","size":93,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-03T12:17:53.409Z","etag":null,"topics":["angular","data-table","directive","table","ui"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JasonBoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-02T10:17:16.000Z","updated_at":"2023-03-04T06:05:22.000Z","dependencies_parsed_at":"2023-07-18T02:19:17.429Z","dependency_job_id":null,"html_url":"https://github.com/JasonBoy/ly-table","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"2182bbf851a42409ad69fa384f085400ccf78c43"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBoy%2Fly-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBoy%2Fly-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBoy%2Fly-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBoy%2Fly-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JasonBoy","download_url":"https://codeload.github.com/JasonBoy/ly-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924746,"owners_count":20694777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","data-table","directive","table","ui"],"created_at":"2024-10-01T13:18:43.293Z","updated_at":"2025-03-27T21:22:18.781Z","avatar_url":"https://github.com/JasonBoy.png","language":"JavaScript","readme":"# ly-table\nSimple Angular Table Directive\n\nThis angular directive will create a html table based on the `data` and `columns` and other options.\nWe can pass html for every column, and with other angular directive, like `ng-click`,  \nyou can pass any function to the table to add more logic with $scope attached.\n\n\u003e WARN: This directive only displays table data without any pagination function, do it with other plugins or by yourself\n\n### Usage\n\n`npm install ly-table`  \nJust import 'angular.js' , 'angular-sanitize.js' and the `ly-table.js`,  \nor  \nfor commonjs env, just `require('ly-table')`,  \n`var app = angular.module('app', ['lyTable']);`\n\nSimple usage\n```\n  \u003cly-table data=\"data\" columns=\"columns\" auto-escape=\"false\" table-class=\"table-hover\"\u003e\u003c/ly-table\u003e\n```\n\n#### Directive options\n**data**: [Array] Array from $scope, just an array contains all the data,\n```javascript\n$scope.data = [\n  {\n    name: 'jason',\n    age: 10,\n    address: 'shanghai'\n  }\n]\n```\n**columns**: [Array],Array from $scope, define all the columns how to display and other logic need.\n```javascript\n$scope.columns = [\n  {\n    field: 'name', //which is key in 'data' of every row data object,\n    name: 'Age',\n    sortable:true, //if this column is sortable\n    sortBy:''  //sort by name..., if not provided, will sort by field\n    cssClass:'', //css in tbody td\n    headCssClass:'', // css in thead th\n    autoEscape: false, //auto escape the html in this td or not,\n    //if you need add other directive like ng-click in formatter,\n    //set it to false, default value is false\n    formatter:'', //string or function to call to gen the html in the td,\n    //which can compile the html with scope with the help of      \n    //[bindHtmlCompile](https://github.com/incuna/angular-bind-html-compile) directive, see demo\n  }\n];\n```\n**tableClass**: [String], add additional table css class  \n**autoEscape**: [String] true/false. default false, escape/unescape globally  \n\n###Events\n**postLinked**: callback after link function  \n**sorting**: listen on the event to be notified when user click the thead td,\nsort class `active`, `sortable` will be added to the `thead \u003e tr \u003e th \u003e span` element based on the sort status   \n  ```\n  $scope.$on('sorting', function(e, column) {\n    var by = column.sortBy;\n    var dir = column.sortDir; //1: desc, else asc\n  }\n  ```\n\n### Demo\nSee the demo in demo folder\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonboy%2Fly-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonboy%2Fly-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonboy%2Fly-table/lists"}