繁体   English   中英

我在编译时收到西兰花错误

[英]Im getting a broccoli error when compiling

我运行ember并得到以下信息:

ember s
version: 2.4.2
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [TemplateCompiler] failed with:
Error: EEXIST: file already exists, symlink '/Users/myname/Documents/source-code/route-app/tmp/template_compiler-input_base_path-knvK6YsL.tmp/0/route-app/templates/components/event-form.js' -> '/Users/myname/Documents/source-code/route-app/tmp/template_compiler-output_path-nJ5NYRH1.tmp/route-app/templates/components/event-form.js'
at Error (native)
at Object.fs.symlinkSync (fs.js:897:18)

我手动创建了这些文件,但没有使用ember g。 这是我的组件的hbs和js文件:

hbs文件:

<h2>Add New Event</h2>

<form {{action 'addEvent' on='submit'}}>
 <div>
   <label for="">Event Date</label>
   {{input value=event.date}}
   <label for="">Event Name</label>
   {{input value=event.name}}
   <label for="">City</label>
   {{input value=event.city}}
   <label for="">State</label>
   {{input value=event.state}}
</div>
<button type="submit">Add Event</button>
</form>

js文件:

import Ember from 'ember';

export default Ember.Component.extend ({
  actions:
  {
    addEvent: function() {
      this.sendAction('action', this.event);
    }
  }
});

两者都在../templates/components目录中。

知道我在做什么错吗? 该组件是保留名称还是其他名称? 我迷路了!

js文件必须放置在“ ../components”目录中。

模板将被转换为'template'目录中的js文件,但您的情况下已经存在一个js文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM