文件:
compiler.umd.js
path:
turbo_modules/@angular/compiler@9.1.12/bundles:
函数名:TemplateParser.prototype.parse
TemplateParser.prototype.parse = function(component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {
var result = this.tryParse(component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces);
var warnings = result.errors.filter(function(error) {
return error.level === exports.ParseErrorLevel.WARNING;
});
var errors = result.errors.filter(function(error) {
return error.level === exports.ParseErrorLevel.ERROR;
});
if (warnings.length > 0) {
this._console.warn("Template parse warnings:\n" + warnings.join('\n'));
}
if (errors.length > 0) {
var errorString = errors.join('\n');
throw syntaxError("Template parse errors:\n" + errorString, errors);
}
return {
template: result.templateAst,
pipes: result.usedPipes
};
}
如果把form后面中括号的formGroup改成formGroup2:
错误消息:Can’t bind to ‘formGroup2’ since it isn’t a known property of ‘form’. ("
检查逻辑位于compiler.umd.js里的TemplateParseVisitor.prototype._checkPropertiesInSchema函数:
检查的具体细节:Schema里包含的form元数据:
报错: