In a project where I use EAK i have the two controllers:
controllers/autocomplete.js:
export default Ember.Controller.extend({
search: "intiial value",
searchText: null,
searchResults: function() {
console.log("autocomplete controller");
var searchText = this.get('searchText');
this.set('search', "ntueontueotueo");
console.log(this.get('search'));
if (!searchText) {
return;
} else {
return ["One", "Two", "Three"];
}
}.property("searchText")
});
controllers/persons.js:
export default Ember.ArrayController.extend({
needs: 'autocomplete',
search: Ember.computed.alias("controllers.autocomplete.search"),
searchResults: function() {
console.log("Persons Controller");
return this.get('search');
}.observes('search')
});
In persons.hbs {{search}} is not being updated when i change autocomplete.searchText and the searchResults function is never called. What am I doing wrong?