{"id":17033130,"url":"https://github.com/gbbr/ngnode","last_synced_at":"2025-03-22T21:20:08.849Z","repository":{"id":17560130,"uuid":"20363442","full_name":"gbbr/ngNode","owner":"gbbr","description":"AngularJS Directive Helper service","archived":false,"fork":false,"pushed_at":"2014-05-31T21:53:00.000Z","size":172,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T01:15:25.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-31T19:28:17.000Z","updated_at":"2014-08-05T16:19:56.000Z","dependencies_parsed_at":"2022-09-24T17:20:42.185Z","dependency_job_id":null,"html_url":"https://github.com/gbbr/ngNode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbr%2FngNode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbr%2FngNode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbr%2FngNode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbbr%2FngNode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbbr","download_url":"https://codeload.github.com/gbbr/ngNode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245020953,"owners_count":20548268,"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":[],"created_at":"2024-10-14T08:32:36.838Z","updated_at":"2025-03-22T21:20:08.795Z","avatar_url":"https://github.com/gbbr.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## ngNode\n#### Lightweight directive helper service\n\n\nProvides the $node helper service to directives for easy access to DOM Elements in their templates.\n\nTo use, add the `ng-node` attribute to the desired HTML Elements and pass the desired $node property name as value.\nFor example, using `ng-node=\"btnCancel` will make `$node.btnCancel` available on the service for the directive.\n\nImproves mainainability and readibility. Helps leave out redundant DOM queries.\n\n__HTML__\n\n```html\n\u003cmy-directive\u003e\n  \u003cbutton ng-node=\"btnHome\"\u003e\n    \u003clabel\u003eHome\u003c/label\u003e\n  \u003c/button\u003e\n  \n  \u003cbutton ng-node=\"btnContact\"\u003e\n    \u003clabel\u003eContact\u003c/label\u003e\n  \u003c/button\u003e\n  \n  \u003cdiv class=\"output\" ng-node=\"txtOutput\"\u003e\u003c/div\u003e\n\u003c/my-directive\u003e\n```\n\n__JS__\n\n```js\nangular.module('myModule', ['ngNode']);\nangular.module('myModule').directive('myDirective', function($node) {\n  /* ... */\n  return {\n    restrict: 'E',\n    link: function() {\n      $node.btnHome.on('click', goHome);\n      $node.btnContact.on('click', showContact);\n      $node.txtOutput.html('Hello world!');\n    }\n  }\n});\n```\n\nWARNING: Do not use within controllers. DOM Manipulation should only be done in directives according to AngularJS best practices.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbbr%2Fngnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbbr%2Fngnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbbr%2Fngnode/lists"}