javascript - Ember.js change router statement within view -


suppose have view:

cellar.searchtextfield = ember.textfield.extend({     insertnewline: function(){       // cellar.searchcontroller.loadresults();     } }); 

and have route:

cellar.router.map(function() {   this.route('search', { path: '/search'}); }); 

how can change app url host/#/search? when submitting view's textfield? or best , logic way implement search forms in ember applications?

i working using:

app.searchfield = ember.textfield.extend({     insertnewline: function() {                 this.get('controller').transitiontoroute('search', this.get('value'));     } }); 

this transition search route, can load , filter data on model hook.

here jsfiddle demo


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -