Closed beeekind closed 9 years ago
You should import the file under the 'globals' folder.
I keep this issue opened so we can create an easier way to install em-forms with ember-cli
I linked the main.coffee file in my dist folder in index.html but I am still getting the same error.
What do you mean by 'globals' folder?
Code can be found here: https://github.com/bjones6/front-end
Error output: "Handlebars error: Could not find property 'em-form' on object"
Browsers has no idea about coffee, you should link to the file under vendor/ember-form/dist/globals/main.js
When I build the app the dist directory does not contain a 'globals' folder. Instead it contains assets, ember-forms, and test, subdirectories.
dist/ember-forms contains lib/main.coffee. Notably lib does not contain any of the forms or components, just main.coffee.
My vendor directory that's created with 'bundle install --save ember-forms' also does not contain a globals folder.
It appears i'm not building the dependency with ember-cli correctly. It seems including 'app.import('vendor/ember-forms/lib/main.coffee');' in brocfile.js does not have the same as effect as a comparable statement like 'app.import('vendor/moment/moment.js');' because main.coffee builds a single file from multiple directories.
Any idea how to build ember-forms using ember-cli's brocfile? If not do you mind uploading a pre-built ember-forms file (I'm assuming main.js is what I ultimately need to import into the global namespace).
Thanks for the help
@bjones6 I'm sorry, during the last refactoring we cleaned up the dist folder,
I'm taking care of it right now.
@bjones6 I released 0.2, it should contain the dist folder now.
Yup, works now. I've added the final working solution to my original comment. Thanks for the quick help.
in my ember-cli generated folder, i wrote: bower install --save ember-forms
then in my ember-cli generated brocfile.js i added app.import('bower_components/ember-forms/dist/globals/main.js');
(instead of "vendor/..." i used "bower_components")
this worked fine, thanks for help!
I keep receiving an error from handle bars say 'em-form' is undefined.
I've installed it into the vendor directory with 'bower install --save ember-forms.'
Then I imported it into the brocfile with 'app.import('vendor/ember-forms/lib/main.coffee');'
Is it some incompatibility with ember-cli and .coffee files? My understanding is that they're supported out of the box.
Any help would be much appreciated!
SOLUTION:
Install into /vendor with bower : 'bower install --save ember-forms'
Add the following import into your brocfile.js file: 'app.import('vendor/ember-forms/dist/globals/main.js');'
Build and run your app: 'ember s'
You now have em-forms as a recognized global in your project, and can follow the documentation (http://indexiatech.github.io/ember-forms/#/quickexample) to actually implement them. ;)