0

ember s を実行すると、次の結果が得られます。

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 ディレクトリにあります。

私が間違っていることは何ですか?このコンポーネントは予約名か何かですか? 道に迷いました!

4

1 に答える 1

1

Js ファイルは「../components」ディレクトリに配置する必要があります。

テンプレートは 'template' ディレクトリの js ファイルに変換されますが、js ファイルは既に存在します。

于 2016-04-11T04:07:55.163 に答える