{"id":18310881,"url":"https://github.com/jimschubert/angular-features","last_synced_at":"2025-04-09T12:10:37.163Z","repository":{"id":28818402,"uuid":"32341704","full_name":"jimschubert/angular-features","owner":"jimschubert","description":"Easily constrain client access to beta features.","archived":false,"fork":false,"pushed_at":"2015-09-13T18:42:48.000Z","size":194,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T06:05:10.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jimschubert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-16T17:33:49.000Z","updated_at":"2016-01-14T15:12:26.000Z","dependencies_parsed_at":"2022-08-30T16:11:00.514Z","dependency_job_id":null,"html_url":"https://github.com/jimschubert/angular-features","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fangular-features","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fangular-features/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fangular-features/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fangular-features/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimschubert","download_url":"https://codeload.github.com/jimschubert/angular-features/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036066,"owners_count":21037092,"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-11-05T16:15:47.429Z","updated_at":"2025-04-09T12:10:37.144Z","avatar_url":"https://github.com/jimschubert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-features\n\n[![Join the chat at https://gitter.im/jimschubert/angular-features](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jimschubert/angular-features?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![Code Climate](https://codeclimate.com/github/jimschubert/angular-features/badges/gpa.svg)](https://codeclimate.com/github/jimschubert/angular-features)\n\nEasily constrain client access to beta features.\n\nThis isn't meant to be an authorization plugin or to restrict access to areas\nof your application. This works more like A-B testing of features for a subset\nof users.\n\n## Build\n\nInstall grunt:\n\n    npm install -g grunt\n\nInstall dependencies:\n\n    npm install -d\n\nRun grunt:\n\n    grunt\n\n## Install\n\n`bower install angular-features`  \n\n## Usage\n\nThe http interceptor will, by default, remove any HTML elements in a response\ncontaining the attribute `data-feature`. The\nprefix and the feature key are both configurable. To allow a user access to a\nfeature, strings representing the feature name\n(value of the `data-feature` attribute) must be added during the config phase\nof AngularJS.\n\n## Example\n\nInclude some partial\n\n    \u003cdiv ng-include=\"'./partial.html'\"\u003e\u003c/div\u003e\n\nPartial's contents are:\n\n    \u003cdiv\u003e\n        \u003cp\u003e\n            \u003ch2\u003eThis is an example\u003c/h2\u003e\n            \u003cem\u003eFeature exclusion should include the example feature below:\u003c/em\u003e\n        \u003c/p\u003e\n        \u003cp ng-feature=\"Sample\"\u003e\n            This is an example feature\n        \u003c/p\u003e\n    \u003c/div\u003e\n\nConfigure your interceptor to override the feature attribute prefix from the\ndefault of `data` to `ng` and add `Sample` as an available feature (remember to\ninclude `inc.features` dependency). Then push `featureInclusion`\nto available interceptors:\n\n    angular.module('myApp',['inc.features'])\n            .config(function($httpProvider, featureInclusionProvider){\n                featureInclusionProvider\n                        .setPrefix('ng')\n                        .defineAllFeatures(['Sample']);\n                $httpProvider.interceptors.push('featureInclusion');\n            });\n\n## Options\n\n_TODO_ List out available options on the interceptor's provider.\n\n\n# License\n\n(The MIT License)\n\nCopyright (c) 2015 Jim Schubert \u003cjames.schubert@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the 'Software'), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Other Licenses\n\nPurl: Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fangular-features","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimschubert%2Fangular-features","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fangular-features/lists"}