{"size": 1790, "ext": "js", "max_stars_repo_path": "src/common/directives/hateoasTable/hateoas-table.directive.js", "max_stars_repo_name": "uhndev/hateoas-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/common/directives/hateoasTable/hateoas-table.directive.js", "max_issues_repo_name": "uhndev/hateoas-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/common/directives/hateoasTable/hateoas-table.directive.js", "max_forks_repo_name": "uhndev/hateoas-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.1481481481, "max_line_length": 106, "alphanum_fraction": 0.6374301676}
/**
 * @name hateoas-table
 * @description hateoasTable is a helper directive designed to help minimize boilerplate table code that
 *              is required to render a hateoas response.  As part of its operation, it requires several
 *              variables that are passed in from a parent scope to the isolate scope.
 *              It is important to note that the actual call to the server exists within this directive's
 *              controller, and we allow a function to intercept and 'masssage' the data as needed before
 *              being rendered to the table.
 * @example
 *
 * In your model.tpl.html:
 *   <hateoas-table
       url="{{model.url}}"
       query="model.query"
       selected="model.selected"
       allow="model.allow"
       resource="model.resource"
       on-resource-loaded="model.onResourceLoaded">
     </hateoas-table>

 * In your model.controller.js, the variables listed above *must* be defined in order for them to be bound
 * back from the child scope in this directive.  You will also need to define an intermediary function in
 * your parent controller:
 *
 * function onResourceLoaded(data) {
 *   // do something to the data returned from server before being rendered to table
 *   return data;
 * }
 *
 */
(function() {
  'use strict';

  angular
    .module('dados.common.directives.hateoasTable', [
      'dados.common.directives.hateoasTable.controller'
    ])
    .component('hateoasTable', {
      bindings: {
        url: '@',
        query: '=',
        selected: '=',
        allow: '=',
        resource: '=',
        onSelect: '=?',
        onResourceLoaded: '=?'
      },
      templateUrl: 'directives/hateoasTable/hateoas-table.tpl.html',
      controller: 'HateoasTableController',
      controllerAs: 'ht'
    });

})();
