Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

How to setup? #19

Closed
millisami opened this issue Feb 1, 2014 · 9 comments
Closed

How to setup? #19

millisami opened this issue Feb 1, 2014 · 9 comments

Comments

@millisami
Copy link

Hi I am finding it hard to integrate it with my existing ember app.
Can anybody point on how to integrate it.
I am sure I am not placing the files in correct places!!!

@ldevalliere
Copy link
Contributor

If you look the file app.coffee (https://github.com/Addepar/ember-widgets/blob/master/app/app.coffee) in this repo (the app folder holds an example application using the ember-widgets). In app.coffee we include the compiled down source code of ember-widgets with "require 'dist/ember-widgets'". Also then in your CSS include the LESS or CSS file to get the styling either from the src folder or the dist folder.

@millisami
Copy link
Author

Well its not working for me and I am sure that I am missing something.

The error is:

Uncaught Error: <Ember._MetamorphView:ember240> Handlebars error: Could not find property 'popover-link-component' on object (generated index controller). 

I just want to use the minimal popover and popover-link components only.
Here is the demo repo I am trying on.
Its in the ember-widgets branch at https://github.com/millisami/emberwidgets-workout/tree/ember-widgets

To start the server, just run cake server. Can you please look into it!! Thanks

@millisami
Copy link
Author

Well I fixed the above.
I was due to the files not getting loaded.
Now I am seeing this error Uncaught ReferenceError: _ is not defined
The line is at https://github.com/millisami/emberwidgets-workout/blob/ember-widgets/vendor/scripts/ember_widgets/mixins.coffee#L21

I 've updated the branch.
Does it have the underscorejs library dependency?

@millisami
Copy link
Author

Well after adding the underscorejs library, that error is fixed and now I am seeing the component.
But when clicking it, the error is:

Assertion failed: You specified the layoutName popover for <Ember.Widgets.PopoverComponent:ember277>, but it did not exist. 

I've updated the widgets branch.

@millisami
Copy link
Author

After adding popover.hbs

<div class="arrow"></div>
{{#if title}}
  <h4 class="popover-title">{{title}}</h4>
{{/if}}
<div class="popover-content">
  {{view view._contentViewClass}}
</div>

into apps template folder fixed it.
But when putting it inside templates/components/popover.hbs does not work. Have to put in templates/popover.hbs works.

Is it the supposed behaviour??
Well now I will try out with the custom component!! which is my target to accomplish.
Pushed the branch as well.

@millisami
Copy link
Author

Well after this, adding that custom component was breeze.
Its in this commit!!
millisami/emberwidgets-workout@9dc43cf

But this repo is managed by Brunch.
Adding this into my existing ember-rails app is not working!!!
Shit head!

Overall, I can say it works.
Things that I would like to address:

  1. Setup readme is required badly
  2. Is underscore js really a heavy dependency which is not listed in your site under the dependency section?
  3. The files should be structured in such a way that to just use the couple of components only (not whole ember-widgets), the inclusion of the features should be very light and isolated.

@jekiii
Copy link

jekiii commented Feb 19, 2014

I second your recommendations in points 1 and 3. I think underscore or lo-dash is required.

@azirbel
Copy link
Contributor

azirbel commented Jul 18, 2014

Thanks for your comments @millisami!

  1. Definitely agree. We'll be working on better docs in general soon; for now, hopefully the new JS Bin Starter Kit (linked in the README) can get people started.
  2. Yes; it's listed now in the README and I'll update it in the main docs as part of that effort.
  3. Agree; added as a new issue: Make it easy to include components individually #68.

@azirbel azirbel closed this as completed Jul 18, 2014
@millisami
Copy link
Author

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants