{"id":32267035,"url":"https://github.com/ezraroi/ngjstree","last_synced_at":"2025-10-22T21:54:41.146Z","repository":{"id":20488545,"uuid":"23766708","full_name":"ezraroi/ngJsTree","owner":"ezraroi","description":"Angular Directive for the famous JS Tree ","archived":false,"fork":false,"pushed_at":"2024-06-05T15:45:32.000Z","size":2025,"stargazers_count":270,"open_issues_count":28,"forks_count":95,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-10-14T18:20:37.694Z","etag":null,"topics":["angular","jstree"],"latest_commit_sha":null,"homepage":"http://ezraroi.github.io/ngJsTree/","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/ezraroi.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}},"created_at":"2014-09-07T18:01:31.000Z","updated_at":"2024-05-08T02:43:02.000Z","dependencies_parsed_at":"2022-09-09T11:40:38.846Z","dependency_job_id":"f781d1aa-0d31-4342-acd4-67297224b9af","html_url":"https://github.com/ezraroi/ngJsTree","commit_stats":{"total_commits":92,"total_committers":14,"mean_commits":6.571428571428571,"dds":0.1630434782608695,"last_synced_commit":"1dcb95f6d149ca6c56071a5baafa8c2c42a28c9b"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/ezraroi/ngJsTree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezraroi%2FngJsTree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezraroi%2FngJsTree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezraroi%2FngJsTree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezraroi%2FngJsTree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ezraroi","download_url":"https://codeload.github.com/ezraroi/ngJsTree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezraroi%2FngJsTree/sbom","scorecard":{"id":389256,"data":{"date":"2025-08-11","repo":{"name":"github.com/ezraroi/ngJsTree","commit":"1dcb95f6d149ca6c56071a5baafa8c2c42a28c9b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 9/23 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T17:24:04.892Z","repository_id":20488545,"created_at":"2025-08-18T17:24:04.893Z","updated_at":"2025-08-18T17:24:04.893Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280520821,"owners_count":26344439,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","jstree"],"created_at":"2025-10-22T21:54:36.968Z","updated_at":"2025-10-22T21:54:41.136Z","avatar_url":"https://github.com/ezraroi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Bower version](https://badge.fury.io/bo/ng-js-tree.svg)](http://badge.fury.io/bo/ng-js-tree)\n[![Build Status](https://travis-ci.org/ezraroi/ngJsTree.svg?branch=master)](https://travis-ci.org/ezraroi/ngJsTree)\n[![Dependency Status](https://gemnasium.com/ezraroi/ngJsTree.svg)](https://gemnasium.com/ezraroi/ngJsTree)\n[![Coverage Status](https://img.shields.io/coveralls/ezraroi/ngJsTree.svg)](https://coveralls.io/r/ezraroi/ngJsTree?branch=master)\n[![Code Climate](https://codeclimate.com/github/ezraroi/ngJsTree/badges/gpa.svg)](https://codeclimate.com/github/ezraroi/ngJsTree)\n[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)\n[![NPM](https://nodei.co/npm/ng-js-tree.png?mini=true)](https://npmjs.org/package/ng-js-tree)\n\nngJsTree\n========\n\nAngular Directive for the famous [JS Tree] library.\n\n\n## Dependencies\n\n\nThe ngJsTree depends on the following libraries:\n* Angular\n* JsTree\n\n\n## Install\n\n\nYou can install the ngJsTree with bower:\n\n```bat\nbower install ng-js-tree --save\n```\n\nor with npm:\n```bat\nnpm install ng-js-tree --save\n```\n\n\nor you can add the ngJsTree.min.js file to your HTML page:\n```html\n\u003cscript src=\"jquery.js\"/\u003e\n\u003cscript src=\"angular.js\"/\u003e\n\u003cscript src=\"jstree.min.js\"/\u003e\n\u003cscript src=\"ngJsTree.min.js\"/\u003e\n```\n\nAdd the `ngJsTree` to your module dependencies\n\n\n# Documentation\n\n\nYou can find the JSTree documentation at [this link]\n\n## Usage\n\n```html\n\u003cdiv js-tree=\"treeConfig\" ng-model=\"treeData\" should-apply=\"ignoreModelChanges()\" tree=\"treeInstance\" tree-events=\"ready:readyCB;create_node:createNodeCB\"\u003e\u003c/div\u003e\n```\n\n* `treeConfig` - This is the configuration object of the JsTree, if you will not supply one, an empty one will be created (not mandatory).\n* `treeData` - The array with the elements of the tree, will be used for data binding (adding / removing / updating this data will be reflected in the tree).\n* `ignoreModelChanges()` - A method that returns true or false. when returning false, model changes will not be reflected in the tree (not mandatory).\n* `treeInstance` - The Js Tree instance will be assigned to this variable in your controller scope (not mandatory).\n* `ready:readyCB;create_node:createNodeCB` - List of Js Tree events and callbacks in your controller scope that will be called for each event (not mandatory).\n\n\n### Registering for events\nYou can register a callback for any Js Tree event in one of the following ways:\n\n* add the `tree-events` attribute and specify the name of the events to register for and a callback for each event.\n\nExample:\n```html\n\u003cdiv ng-controller='myCtrl'\u003e\n    \u003cdiv js-tree=\"treeConfig\" ng-model=\"treeData\" should-apply=\"ignoreModelChanges()\" tree=\"treeInstance\" tree-events=\"ready:readyCB;create_node:createNodeCB\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n```javascript\nangular.module('myApp').controller('myCtrl', function($scope,$log) {\n    $scope.readyCB = function() {\n        $log.info('ready called');\n    };\n\n    $scope.createNodeCB = function(e,item) {\n        $log.info('create_node called');\n    };\n);\n```\n\n* add the `tree-events-obj` attribute passing an object containing the list of events with the callback objects.\n\nExample:\n```html\n\u003cdiv ng-controller='myCtrl'\u003e\n    \u003cdiv js-tree=\"treeConfig\" ng-model=\"treeData\" should-apply=\"ignoreModelChanges()\" tree=\"treeInstance\" tree-events-obj=\"treeEventsObj\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n```javascript\nangular.module('myApp').controller('myCtrl', function($scope,$log) {\n\n    $scope.treeEventsObj = {\n      'ready': readyCB,\n      'create_node': createNodeCB,\n      'select_node': selectNodeCB   // on node selected callback\n    }\n\n    function readyCB() {\n        $log.info('ready called');\n    };\n\n    function createNodeCB(e,item) {\n        $log.info('create_node called');\n    };\n    \n    function selectNodeCB(node, selected, event) {\n        $log.info(\"some_node_selected\");\n    };\n);\n```\n*NOTE:* Only one of the methods can be used to pass event callbacks, `tree-events` will take precedence.\n\n### Using the Js Tree API from your controller\nAdd the tree attribute to the jstree directive and assign it with a name of a variable in your controller that will hold the jstree instance.\n```html\n\u003cdiv ng-controller='myCtrl'\u003e\n    \u003cdiv js-tree=\"treeConfig\" ng-model=\"treeData\" tree=\"treeInstance\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n```javascript\nfunction yourCtrl($scope)  {\n    var selected_nodes = $scope.treeInstance.jstree(true).get_selected();\n}\n```\n\n### Recreating the Tree\nIf from some reason you would like to recreate the tree, the right way to do it is update the tree configuration object. Once the directive will detect a change to the tree configuration it will destory the tree and recreate it.\n```javascript\nthis.treeConfig = {\n    core : {\n        multiple : false,\n        animation: true,\n        error : function(error) {\n            $log.error('treeCtrl: error from js tree - ' + angular.toJson(error));\n        },\n        check_callback : true,\n        worker : true\n    },\n    version : 1\n};\nthis.reCreateTree = function() {\n    this.treeConfig.version++;\n}\n```\n* The reason I am using the version property is because it is not a JsTree config property, so it will not effect the tree.\n\n## Development\n#### Prepare your environment\n\n* Install [Node.js](http://nodejs.org/) and NPM (should come with)\n* Install global dev dependencies: `npm install -g grunt-cli karma`\n* Install local dev dependencies: `npm install` while current directory is ngJsTree\n* Install javascript dependencies: `bower install` while current directory is ngJsTree\n\n#### Build\n* Build the whole project: `grunt` - this will run `jshint` and `test` and will build the project\n\n\n#### TDD\n* Run test: `grunt watch`\n\nLicense\n----\n\nMIT\n\n[JS Tree]:http://www.jstree.com/\n[this link]:http://www.jstree.com/api/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezraroi%2Fngjstree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fezraroi%2Fngjstree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezraroi%2Fngjstree/lists"}