Open belgoros opened 5 years ago
That's expected. The syntax I've used, which is the preferred one for Octane, does not put actions inside the actions
property. Instead it references actions that are in the root of the object.
The equivalent in classic syntax is:
import Component from '@ember/component';
import EmberObject from '@ember/object';
export default Component.extend({
tagName: '',
cities:['Barcelona', 'London', 'New York', 'Porto'],
destination: 'London',
init() {
this._super(...arguments);
this.tags = this._dummyTags();
this._setSelectedTags();
this.chooseDestination = this.chooseDestination.bind(this)
},
chooseDestination(city) {
this.set('destination', city);
},
...
Your approach is also perfectly fine
@cibernox Thank you for your response. I didn't find any mentions about that neither in the Overview
section nor in the changelog file.
I also discovered some incoherencies in provided examples in the docs pages, e.g. data in the controller does not correspond the one used in the template. For example, in search section, there are names
array declared in the controller, but the template uses diacritics
as options.
I'm using the following versions of Ember and ember-power:
When following the docs on action handling and using the power select in a template as follows:
and the
post-form.js
component defined as follows:it fails with:
If I change
@onChange
to use the syntax as follows:it works. Is it an error of the docs or I'm missing smth ? More of that, the provided syntax fails in a component/controller:
I had to use:
Note: see the use of commas after each declared variable.