Angular2 表单抛出意外字符“EOF";(" [英] Angular2 forms throws Unexpected character "EOF" ("

查看:18
本文介绍了Angular2 表单抛出意外字符“EOF";("的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[注意] 这个问题只是为了帮助其他用谷歌搜索这个错误的人,我自己添加了我的答案.我对问题的格式很差,因为我不想要/不希望对此有任何答案.当我选择回答你自己的问题,Q/A 风格"-.-

我正在忙于制作表单,但收到此错误消息:

<块引用>

意外字符EOF"(

Google 给了我几个结果,但没有一个非常有用.这个问题困扰了我多年.

 

<label for="details">Details</label><textarea formControlName="details" class="form-control" id="details" placeholder="您报告的完整详细信息"><文本区域>

<div class="form-group"><label for="suggested_solution">建议的解决方案</label><textarea formControlName="suggested_solution" class="form-control" id="suggested_solution" placeholder="您对解决方案的建议"></textarea>

<div class="form-group"><label for="attachments">相关附件</label><input formControlName="attachments" type="file" class="form-control" id="attachments">

<button type="submit" class="btn btn-primary" [disabled]="!form.valid">提交</button></表单>

解决方案

我自己的回答感觉有点奇怪,但如果其他人遇到类似的问题,我想分享一下!基本上我的问题出在 textarea 上:

<textarea formControlName="details" class="form-control" id="details" placeholder="有关您报告的完整详细信息"><文本区域>

textarea 没有关闭(我忘记了最后的正斜杠).尝试从该死的错误消息中找到它.

基本上,在我看来,这个问题可能是由许多问题引起的(我已经阅读了类似于 <!-- ---->),但对我来说是 textareas.

希望有人觉得这有用:)

[note] this question is merely to give aid to other people who google for this error, and I've added my answer myself. I formatted the question poorly, as I didn't want/expect any answers to this. Thought SO would mark my question with a tag or smtn when I ticket the "Answer your own question, Q/A style" -.-

I was messing around with making forms, and I got this error message:

Unexpected character "EOF" ("

Google gave me several results, but none of them were very useful. This issue plagued me for ages.

  <div class="form-group">
    <label for="details">Details</label>
    <textarea formControlName="details" class="form-control" id="details" placeholder="Full details on your report"> <textarea>
  </div>

  <div class="form-group">
    <label for="suggested_solution">Suggested Solution</label>
    <textarea formControlName="suggested_solution" class="form-control" id="suggested_solution" placeholder="Your suggestion for a solution"></textarea>
  </div>

  <div class="form-group">
    <label for="attachments">Relevant attachments</label>
    <input formControlName="attachments" type="file" class="form-control" id="attachments">
  </div>

  <button type="submit" class="btn btn-primary" [disabled]="!form.valid">Submit</button>
</form>

解决方案

It feels a little weird answering myself, but in case someone else runs into a similar issue, I wanted to share it around! Basically my issue was with the textarea:

<textarea formControlName="details" class="form-control" id="details" placeholder="Full details on your report"> <textarea>

The textarea didn't get closed (I forgot a forward slash on the end). Try finding that from the freakin error message.

Basically, what it looks like to me is that this issue can be caused by numerous problems (I've read about poorly formatted comments akin to <!-- ----> ), but for me it was textareas.

Hopefully someone finds this useful :)

这篇关于Angular2 表单抛出意外字符“EOF";(&quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆