Visitar URL original
GitHub - NicolasBonduel/Angular-Boldificator: An angular filter that bold a list of words in a sentence. · GitHub
Skip to content

About

An angular filter that bold a list of words in a sentence.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Angular-Boldificator

An angular filter that bold a list of words in a sentence.

var m = angular.module('yourModule'  ['boldificator', 'ngSanitize']);

m.controller('defaultCtrl', function($scope) {
  $scope.text = "Bacon ipsum dolor amet short loin et eu porchetta ut ipsum, cupim lorem cow qui kielbasa.";
  $scope.bold = ["Bacon", "porchetta", "cow"];
});
<div ng-controller='defaultCtrl'>
  <p ng-bind-html="text | boldificator:bold"></p>
</div>

Result : Bacon ipsum dolor amet short loin et eu porchetta ut ipsum, cupim lorem cow qui kielbasa.

Be careful, you may need "ngSanitize" for the rendering.


Thanks to the Bacon Ipsum API for the nice example ;)


Nicolas Bonduel

About

An angular filter that bold a list of words in a sentence.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages