nl_tokens: @ngdoc directive @name mdGridTile @module material . components . gridList @restrict E @description Tiles contain the content of an md - grid - list . They span one or more grid cells vertically or horizontally and use md - grid - tile - { footer header } to display secondary content .
pl_tokens: function GridTileDirective ( $mdMedia ) { return { restrict : 'E' , require : '^mdGridList' , template : '<figure ng-transclude></figure>' , transclude : true , scope : { } , // Simple controller that exposes attributes to the grid directive controller : [ "$attrs" , function ( $attrs ) { this . $attrs = $attrs ; } ] , link : postLink } ; function postLink ( <mask> , element , attrs , gridCtrl ) { // Apply semantics element . attr ( 'role' , 'listitem' ) ; // If our colspan or rowspan changes, trigger a layout var unwatchAttrs = $mdMedia . watchResponsiveAttributes ( [ 'md-colspan' , 'md-rowspan' ] , attrs , angular . bind ( gridCtrl , gridCtrl . invalidateLayout ) ) ; // Tile registration/deregistration gridCtrl . invalidateTiles ( ) ; scope . $on ( '$destroy' , function ( ) { // Mark the tile as destroyed so it is no longer considered in layout, // even if the DOM element sticks around (like during a leave animation) element [ 0 ] . $$mdDestroyed = true ; unwatchAttrs ( ) ; gridCtrl . invalidateLayout ( ) ; } ) ; if ( angular . isDefined ( scope . $parent . $index ) ) { scope . $watch ( function ( ) { return scope . $parent . $index ; } , function indexChanged ( newIdx , oldIdx ) { if ( newIdx === oldIdx ) { return ; } gridCtrl . invalidateTiles ( ) ; } ) ; } } }