Support ! expressions after refactor
diff --git a/angular_analyzer_plugin/lib/src/resolver.dart b/angular_analyzer_plugin/lib/src/resolver.dart index bdcd056..3fd9f7c 100644 --- a/angular_analyzer_plugin/lib/src/resolver.dart +++ b/angular_analyzer_plugin/lib/src/resolver.dart
@@ -395,7 +395,8 @@ @override void visitPrefixExpression(PrefixExpression exp) { - if (exp.operator.type != TokenType.MINUS) { + if (exp.operator.type != TokenType.MINUS && + exp.operator.type != TokenType.BANG) { _reportDisallowedExpression(exp, exp.operator.lexeme); } }
diff --git a/angular_analyzer_plugin/test/resolver_test.dart b/angular_analyzer_plugin/test/resolver_test.dart index c6fa8ba..eca8c96 100644 --- a/angular_analyzer_plugin/test/resolver_test.dart +++ b/angular_analyzer_plugin/test/resolver_test.dart
@@ -2109,6 +2109,22 @@ } // ignore: non_constant_identifier_names + Future test_expression_unaryNegate_allowed() async { + _addDartSource(r''' +@Component(selector: 'test-panel', templateUrl: 'test_panel.html') +class TestPanel { + bool x; +} +'''); + final code = r""" +{{!x}} +"""; + _addHtmlSource(code); + await _resolveSingleTemplate(dartSource); + errorListener.assertNoErrors(); + } + + // ignore: non_constant_identifier_names Future test_expressionNotAllowed_as() async { _addDartSource(r''' @Component(selector: 'test-panel', templateUrl: 'test_panel.html')