private bool CanMinifyAngularBindingExpressionInAttribute(HtmlTag tag, HtmlAttribute attribute)
{
string tagNameInLowercase = tag.NameInLowercase;
string attributeNameInLowercase = attribute.NameInLowercase;
IList<HtmlAttribute> attributes = tag.Attributes;
bool canMinify = false;
if (tag.Flags.HasFlag(HtmlTagFlags.Custom))
{
string elementDirectiveName = AngularHelpers.NormalizeDirectiveName(tagNameInLowercase);
switch (elementDirectiveName)
{
case "ngPluralize":
canMinify = attributeNameInLowercase == "count" || attributeNameInLowercase == "when";
break;
case "ngMessages":
canMinify = attributeNameInLowercase == "for";
break;
}
}
if (!canMinify)
{
string attributeDirectiveName = AngularHelpers.NormalizeDirectiveName(attributeNameInLowercase);
canMinify = ContainsAngularBindingExpression(attributeDirectiveName);
if (!canMinify)
{
switch (attributeDirectiveName)
{
case "ngTrueValue":
case "ngFalseValue":
canMinify = tagNameInLowercase == "input" && attributes.Any(
a => a.NameInLowercase == "type" && a.Value.Trim().IgnoreCaseEquals("checkbox"));
break;
}
}
}
return canMinify;
}