npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

az-trust-filter

1.0.4

@kentcdodds

npmHomeRepoSnykSocket
Downloads:267
$ npm install az-trust-filter
DailyWeeklyMonthlyYearly

az-trust-filter

Status: npm version npm downloads Build Status Code Coverage

az-trust-filter makes it easier to use the ng-bind-html directive by allowing you to avoid having to escape your stuff in your controller before binding it in the template.

Demo

Installation

npm install -S az-trust-filter

Usage:

Depend on the module

angular.module('yourModule', ['azTrustFilter']);

Use it

<strong>Arbitrary HTML</strong>
<div>
  <input ng-model="userHtml" placeholder="Type at your own risk!" />
</div>
<div ng-bind-html="userHtml | trust"></div>

<hr />

<strong>Custom trust type</strong>
<div>
  <input ng-model="userUrl" type="url"  placeholder="Type a url" />
</div>
<div ng-bind-html="userUrl | trust:'url'"></div>

LICENSE

MIT

Code of Conduct

Contributor Covenant

Credits

The code for this filter was taken (with permission) from Eric Clemmons's post: Angular Trust Filter