Closes #117: fix templates minification

This commit is contained in:
Benjamin Gamard 2017-11-06 00:48:55 +01:00
parent cf9101d157
commit 4d161aea07
2 changed files with 10 additions and 12 deletions

View File

@ -72,12 +72,12 @@ module.exports = function(grunt) {
options: { options: {
append: true, append: true,
htmlmin: { htmlmin: {
collapseBooleanAttributes: true, collapseBooleanAttributes: false,
collapseWhitespace: true, collapseWhitespace: true,
removeAttributeQuotes: true, removeAttributeQuotes: false,
removeComments: true, removeComments: true,
removeEmptyAttributes: true, removeEmptyAttributes: false,
removeRedundantAttributes: true, removeRedundantAttributes: false,
removeScriptTypeAttributes: true, removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true removeStyleLinkTypeAttributes: true
} }
@ -90,12 +90,12 @@ module.exports = function(grunt) {
options: { options: {
append: true, append: true,
htmlmin: { htmlmin: {
collapseBooleanAttributes: true, collapseBooleanAttributes: false,
collapseWhitespace: true, collapseWhitespace: true,
removeAttributeQuotes: true, removeAttributeQuotes: false,
removeComments: true, removeComments: true,
removeEmptyAttributes: true, removeEmptyAttributes: false,
removeRedundantAttributes: true, removeRedundantAttributes: false,
removeScriptTypeAttributes: true, removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true removeStyleLinkTypeAttributes: true
} }

View File

@ -9,12 +9,10 @@ angular.module('docs').directive('file', function() {
template: '<input type="file" />', template: '<input type="file" />',
replace: true, replace: true,
require: 'ngModel', require: 'ngModel',
link: function(scope, element, attr, ctrl) { link: function(scope, element, attrs, ctrl) {
element.bind('change', function() { element.bind('change', function() {
scope.$apply(function() { scope.$apply(function() {
console.log('is multiple?', attr.multiple); attrs.multiple ? ctrl.$setViewValue(element[0].files) : ctrl.$setViewValue(element[0].files[0]);
console.log('setting file directive value', attr.multiple ? element[0].files : element[0].files[0]);
attr.multiple ? ctrl.$setViewValue(element[0].files) : ctrl.$setViewValue(element[0].files[0]);
}); });
}); });
} }