I've written a github issue 2 weeks ago on semantic-ui-ember
's repo but I got no answer yet. That's the reason why I'm reposting it here, hoping for more answers.
I'm trying to make a sample project out of the doc and can't get it working properly with all the docs I went through. I might be missing something really important. I'm actually able to get Semantic modules generated by ember but I get stuck when I try to interact with them and use actions on them.
I tried many different things but the closer I got was by following this guide.
Details on what I did. To see the actual error, please go to the end of my explanation.
- I first installed ember:
npm install -g ember-cli
. - Then I created a new test project:
ember new testEmberSemantic
-
Created the basic templates and a component for my future accordion test:
ember generate template application ember generate template index ember generate component accordion-test
-
Then I install
Semantic-UI-Ember
and generate it:ember install semantic-ui-ember ember generate semantic-ui-ember
-
I then put the following in
templates/components/accordion-test.hbs
:<div class="title"> Semantic UI </div> <div class="content"> Be sure to check out <div class="ui button" onclick="">the example</div> </div> <div class="title"> Example </div> <div class="content"> This is a great example! </div>
-
I added a simple in
templates/index.hbs
and intemplates/application.hbs
.
The error encountered.
-
Then, if I try to run
ember server
and load the webpage atlocalhost:4200
, I have the following error in the console with nothing rendered on it.Assertion Failed: A helper named "execute" could not be found
If I try the same without the execute
and action
parts in templates/components/accordion-test
, I get a normal page but, of course, without event handler on the button.
I kinda guessed, from what I read from the docs than it implicitly calls a method on the ui-accordion component in the base mixin that is supposed to call the method on the semantic component but it's not clearly said.
I even tried to add the following in components/accordion-test
, just to make sure I wasn't required to create the "helper" myself.
import Ember from 'ember';
export default Ember.Component.extend( {
actions: {
execute( command, argumentOne ) {
$( '.ui.accordion' ).accordion( command, argumentOne );
}
}
} );
But that didn't help. I think the main problem probably comes from my usage of Semantic-UI-Ember
but this is the closest I can get to something working based on what I can find in the docs. Maybe that needs to be updated, to make sure a newcomer can get to a working example easily.
Also, I did all of this using node v7.1.0
once and then tried it again (from scratch) with the 6.9.1
version and got the same results. So, it doesn't seem to be linked with the node version, here.
Thank you for your patience while reading this. :)
PS: This post might require a new tag called semantic-ui-ember
as it uses this framework but I don't have the reputation to do so. Please, feel free to create it and tag this post to it. Thank you.
Aucun commentaire:
Enregistrer un commentaire