javascript - Ember.js: how can I find all bindings for a component without knowing the model and properties -
how can find bindings given component @ runtime. in example below, attribute name ('value') , bound model property ('model.firstname') either route or controller.
example: html
<script type="text/x-handlebars" data-template-name="index"> <x-input label="name" value={{model.firstname}}></x-input> </script>
js
var app = ember.application.create({}); app.person = ember.object.extend({ firstname: null, lastname: null, fullname: ember.computed('firstname', 'lastname', function() { return (this.get('firstname') + ' ' + this.get('lastname')).trim(); }) }); app.indexroute = ember.route.extend({ person: null, model: function () { if(!this.person) { this.person = app.person.create({ firstname: '', lastname: '' }) } return this.person; }, actions: {} });
i trying use webcomponents , not ember components ({{...}}). 1 way data-binding works above example, trying figure out if can wire 2 way databinding this. new ember , wanted pointers if there api existing bindings component.
Comments
Post a Comment