Improve this Doc  View Source

$$messageFormat

  1. - service in module ngMessageFormat

Angular internal service to recognize MessageFormat extensions in interpolation expressions. For more information, see: https://docs.google.com/a/google.com/document/d/1pbtW2yvtmFBikfRrJd8VAsabiFkKezmYZ_PbgdjQOVU/edit

Example

<div ng-controller="AppController">
  <button ng-click="decreaseRecipients()" id="decreaseRecipients">decreaseRecipients</button><br>
  <span>{{recipients.length, plural, offset:1
          =0    {{{sender.name}} gave no gifts (\#=#)}
          =1    {{{sender.name}} gave one gift to {{recipients[0].name}} (\#=#)}
          one   {{{sender.name}} gave {{recipients[0].name}} and one other person a gift (\#=#)}
          other {{{sender.name}} gave {{recipients[0].name}} and # other people a gift (\#=#)}
        }}</span>
</div>