/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.1.3 */ goog.provide('ngmaterial.components.truncate'); goog.require('ngmaterial.core'); /** * @ngdoc module * @name material.components.truncate */ MdTruncateController['$inject'] = ["$element"]; angular.module('material.components.truncate', ['material.core']) .directive('mdTruncate', MdTruncateDirective); /** * @ngdoc directive * @name mdTruncate * @module material.components.truncate * @restrict AE * @description * * The `md-truncate` component displays a label that will automatically clip text which is wider * than the component. By default, it displays an ellipsis, but you may apply the `md-clip` CSS * class to override this default and use a standard "clipping" approach. * * Note: The `md-truncate` component does not automatically adjust it's width. You must * provide the `flex` attribute, or some other CSS-based width management. See the * demos for examples. * * @usage * * ### As an Element * * *
* Back * * Chapter 1 - The Way of the Old West * * Forward *
*
* * ### As an Attribute * * *

Some Title With a Lot of Text

*
* * ## CSS & Styles * * `` provides two CSS classes that you may use to control the type of clipping. * * Note: The `md-truncate` also applies a setting of `width: 0;` when used with the `flex` * attribute to fix an issue with the flex element not shrinking properly. * *
* * * * Assigns the "ellipsis" behavior (default) which will cut off mid-word and append an ellipsis * (…) to the end of the text. * * * * Assigns the "clipping" behavior which will simply chop off the text. This may happen * mid-word or even mid-character. * * * *
*/ function MdTruncateDirective() { return { restrict: 'AE', controller: MdTruncateController, controllerAs: '$ctrl', bindToController: true } } /** * Controller for the component. * * @param $element The md-truncate element. * * @constructor * ngInject */ function MdTruncateController($element) { $element.addClass('md-truncate'); } ngmaterial.components.truncate = angular.module("material.components.truncate");