gender
Filter to translate Communicate Gender number into Unknown, Male (2), or Female (3)
- Name
- {{example.profile.name}}
- Gender
- {{example.profile.gender | gender}}
<div ng-controller="GenderFilterExampleController as example">
<dl class="dl-horizontal dt-as-left-aligned short-list">
<dt>Name</dt>
<dd>{{example.profile.name}}</dd>
<dt>Gender</dt>
<dd>{{example.profile.gender | gender}}</dd>
</dl>
</div>
app.controller('GenderFilterExampleController', [function() {
this.profile = {
name: 'Agent 99',
gender: 3
};
}]);
to_trusted
Filter to "trust" the HTML source. This is useful for binding HTML from the API.
Please use caution when using this filter. If you find yourself storing bits and
pieces of HTML in a service or controller, consider using an ng-include
or a directive
instead.
<div ng-controller="ToTrustedController as example">
<span ng-bind-html="example.quote | to_trusted"></span>
</div>
app.controller('ToTrustedController', [function() {
// This is strictly an example. Please do not store HTML in Javascript files
this.quote = '<blockquote><em>Good thinking, Max.</em> — <strong>Agent 99</strong></blockquote>';
}]);