javascript - Binding checked checkboxes to array attribute in Ember.js -


i have form input fields , checkboxes. route looks this:

sharedcontentnewroute = ember.route.extend   setupcontroller: (controller) ->     content = @modelfor("content")     controller.set('content', @store.createrecord('shared_content'))     controller.set('handles', @store.find("handle")) 

shared_content model has, among other attributes, handle_ids array attribute needs populated ids of checked checkboxes. template populating checkboxes (available handles) defined within shared_content/new template:

... {{#each handles}}   <div class="checkbox">     {{input type="checkbox" id=id}}     <label {{bind-attr for="id"}}>{{data.name}}</label>   </div> {{/each}} ... 

the problem need checked checkboxes ids , put them handle_ids attribute of shared_content model (which model template) before model gets saved. there nice solution kind of binding?

take @ this

http://emberjs.com/guides/getting-started/show-when-all-todos-are-complete/ http://emberjs.com/guides/getting-started/toggle-todo-editing-state/

this can you, when checkbox checked can execute function when check checkbox, can create object on controller/router , save checkbox info there


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -