Angular directive to stop text wrapping a single word to a new line (widows)
1 person uses it
Submitted by: 294948?v=3 IamAdamJowett

No Widows for AngularJS

An AngularJS directive that ensures single words do not wrap onto a new line (widows).

What does No Widows do?

The angular-no-widows directive when placed on a text element will ensure at least two words wrap to a new line, avoiding single word wraps (called widows).


There are three easy ways to install the angular-no-widows directive:


To install via npm, run:


To install via Bower, run:

Manual download

Download the no-widows.directive.js folder, and include it in your index.html file with something like:

Also be sure to include the module in your app.js file with:


To use the angular-no-widows directive, place the no-widows attribute onto a text element, such as a heading or paragraph e.g.



MIT, free to use in personal and commercial projects.

comments powered by Disqus
This page was last updated over 2 years ago.