{"id":20314356,"url":"https://github.com/normandy72/custom-filters","last_synced_at":"2026-05-12T09:32:30.605Z","repository":{"id":153902746,"uuid":"585556542","full_name":"Normandy72/Custom-Filters","owner":"Normandy72","description":"Creating Custom Filters with AngularJS. Coursera course \"Single Page Web Applications with AngularJS\" by Yaakov Chaikin.","archived":false,"fork":false,"pushed_at":"2023-01-05T15:00:30.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T08:44:56.745Z","etag":null,"topics":["angular","angularjs","html","html5","javascript","js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Normandy72.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-05T13:27:26.000Z","updated_at":"2023-01-05T14:14:16.000Z","dependencies_parsed_at":"2023-05-06T16:47:15.291Z","dependency_job_id":null,"html_url":"https://github.com/Normandy72/Custom-Filters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Normandy72/Custom-Filters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FCustom-Filters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FCustom-Filters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FCustom-Filters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FCustom-Filters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Normandy72","download_url":"https://codeload.github.com/Normandy72/Custom-Filters/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FCustom-Filters/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32932401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","angularjs","html","html5","javascript","js"],"created_at":"2024-11-14T18:14:54.899Z","updated_at":"2026-05-12T09:32:30.586Z","avatar_url":"https://github.com/Normandy72.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Steps to create custom filters\n#### Step 1\nDefine Filter Factory Function\n```\nfunction customFilterFactory(){\n    return function(input){\n        // change input\n        return changedInput;\n    };\n}\n```\n#### Step 2\nRegister Filter Factory With Module\n```\nangular.module('app', [])\n.controller('ctrl', Ctrl)\n.filter('custom', customFilterFactory);\n```\n#### Step 3 (Javascript)\nInject it with *name*Filter\n```\nCtrl.$inject = ['$scope', 'customFilter'];\nfunction Ctrl($scope, customFilter){\n    var msg = 'Some input';\n    customFilter(msg);\n};\n```\n\n***\n### Steps to create custom filter that accepts additional custom arguments\n#### Step 1\nDefine Filter (Factory) Function with custom arguments\n```\nfunction customFilterFactory(){\n    return function(input, arg1){\n        // change input\n        return changedInput;\n    };\n}\n```\n#### Step 2\nRegister Filter (Factory) Function with custom arguments\n```\nangular.module('app', [])\n.controller('ctrl', Ctrl)\n.filter('custom', customFilterFactory);\n```\n\n#### Step 3 (Javascript)\nInject it with *name*Filter\n```\nCtrl.$inject = ['$scope', 'customFilter'];\nfunction Ctrl($scope, customFilter){\n    var msg = 'Some input';\n    customFilter(msg, 'some value');\n};\n```\n\n#### Step 3 (HTML)\nUse it as registered name\n```\n{{ \"Hello\" | custom }}\n```\nIf it nessessory - pass extra arguments with `: arg`\n```\n{{ \"Hello\" | custom : arg1 : arg2 }}\n```\nIf it nessessory - chaining filters in HTML\n```\n{{ \"Hello\" | custom | uppercase }}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Fcustom-filters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormandy72%2Fcustom-filters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Fcustom-filters/lists"}