(formatType, FormatClass, tFormats)
| 47 | } |
| 48 | |
| 49 | function applyFormat(formatType, FormatClass, tFormats){ |
| 50 | var i; |
| 51 | if (angular.isArray(tFormats[formatType])) { |
| 52 | // basic change detection; no need to run if no changes |
| 53 | if (!angular.equals(tFormats[formatType], oldFormatTemplates[formatType])) { |
| 54 | oldFormatTemplates[formatType] = tFormats[formatType]; |
| 55 | self.iFormats[formatType] = []; |
| 56 | |
| 57 | if (formatType === 'color') { |
| 58 | instantiateColorFormatters(tFormats); |
| 59 | } else { |
| 60 | for (i = 0; i < tFormats[formatType].length; i++) { |
| 61 | self.iFormats[formatType].push(new FormatClass( |
| 62 | tFormats[formatType][i]) |
| 63 | ); |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | function applyFormats(dataTable, tFormats, customFormatters) { |
| 71 | var formatType, FormatClass, requiresHtml = false; |
no test coverage detected