एक फ़िल्टर बनाने के लिए जो encodeURIComponent को आमंत्रित करता है, निम्नलिखित HTML है -
<div ng-app = "app">
<a href = "/foo/{{ 'bar&baz' | encodeURIComponent }}">Demo</a>
</div> निम्नलिखित हमारा कोणीय है -
var app = angular.module('app', []);
app.filter('encodeURIComponent', function() {
return window.encodeURIComponent;
});