ember.js - How to Populate Ember.Select with Model Data? -


I have read many other questions about amber. Select, but nothing to do enough work. I have dropdowns for filtering some fields in my returned data. Actual filtering is another issue, I am just trying to get a drop down population in the moment.

My work with the steady orange declared on my controller, as I want, but what should I need from the dropdown data to populate with unique values, so I do not have to maintain an option.

I think all I need is a way to set a field in the content property of the selection, but only content = field Or < contentBinding = field has not worked.

Any suggestion or best practice on this will be highly appreciated.

Here is a working code snippet:

  app = Em .Application.create ({displayName: 'Some.App'}); App.Person = DS.Model.extend ({name: DS.attr ('string')}); // This is testing the data that should come from your backend API APP App.Person.FIXTURES = [{id: 1, name: 'John Oliver'}, {ID: 2, name: 'John Stewart'}, {Id: 3, name: 'sank yugur'}]; // In real life, you will use another type of adapter, probability DS.RESTAdapter App.ApplicationAdapter = DS.FixtureAdapter.extend (); App.IndexRoute = Em.Route.extend ({Model: Functions} {this return.store.find ('person');}});  
   & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; Amber Starter Kit & lt; / Title & gt; & Lt; Link href = "// maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel = "stylesheet" & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js" & gt; & Lt; / Script & gt; & Lt; Script src = "http://builds.emberjs.com/tags/v1.7.0/ember.js" & gt; & Lt; / Script & gt; & Lt; Script src = "http://builds.emberjs.com/beta/ember-data.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Script type = "text / x-handlaber" & gt; & Lt; H1 & gt; {{Unbound App.displayName}} & lt; / H1> & Lt; Hour / & gt; {{Outlet}} & lt; / Script & gt; & Lt; Script type = "text / x-handlebars" data-template-name = "index" & gt; & Lt; H3 & gt; Index & lt; / H3 & gt; Le person: {{View Amber. Select Prompt = '- Select -' Content = Controller. Model OptionsWallPath = 'Content.Id' optionLabelPath = "Content .name"}}  


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -