@@ -667,42 +667,42 @@ Ember comes pre-packaged with a set of views for building a few basic controls l
667667They are:
668668
669669####Ember.Checkbox
670-
670+
671671``` handlebars
672- <label>
673- {{view Ember.Checkbox checkedBinding="content.isDone"}}
674- {{content.title}}
675- </label>
672+ <label>
673+ {{view Ember.Checkbox checkedBinding="content.isDone"}}
674+ {{content.title}}
675+ </label>
676676```
677-
677+
678678####Ember.TextField
679-
679+
680680``` javascript
681- App .MyText = Ember .TextField .extend ({
682- formBlurredBinding: ' App.adminController.formBlurred' ,
683- change : function (evt ) {
684- this .set (' formBlurred' , true );
685- }
686- });
681+ App .MyText = Ember .TextField .extend ({
682+ formBlurredBinding: ' App.adminController.formBlurred' ,
683+ change : function (evt ) {
684+ this .set (' formBlurred' , true );
685+ }
686+ });
687687```
688-
688+
689689####Ember.Select
690-
690+
691691``` handlebars
692- {{view Ember.Select viewName="select"
693- contentBinding="App.peopleController"
694- optionLabelPath="content.fullName"
695- optionValuePath="content.id"
696- prompt="Pick a person:"
697- selectionBinding="App.selectedPersonController.person"}}
692+ {{view Ember.Select viewName="select"
693+ contentBinding="App.peopleController"
694+ optionLabelPath="content.fullName"
695+ optionValuePath="content.id"
696+ prompt="Pick a person:"
697+ selectionBinding="App.selectedPersonController.person"}}
698698```
699-
699+
700700####Ember.TextArea
701-
701+
702702``` javascript
703- var textArea = Ember .TextArea .create ({
704- valueBinding: ' TestObject.value'
705- });
703+ var textArea = Ember .TextArea .create ({
704+ valueBinding: ' TestObject.value'
705+ });
706706```
707707
708708
@@ -714,29 +714,26 @@ Example:
714714
715715``` javascript
716716App .MyText = Ember .TextField .extend ({
717- formBlurredBinding: ' App.adminController.formBlurred' ,
718- change : function (evt ) {
719- this .set (' formBlurred' , true );
720- }
721- });
717+ formBlurredBinding: ' App.adminController.formBlurred' ,
718+ change : function (evt ) {
719+ this .set (' formBlurred' , true );
720+ }
721+ });
722722```
723723
724- You can then use this view as a sub view and capture the events. In the following example, a change to the Name input would blurr the form and cause the save button to appear.
725-
726- ``` handlebars
727- <script id="formDetail" data-template-name='formDetail' type="text/x-handlebars">
728- <form>
729- <fieldset>
730- <legend>Info:</legend>
731-
732- {{view App.MyText name="Name" id="Name" valueBinding="myObj.Name"}}
733- <label for="Name">Name</label><br/>
734-
735- {{#if formBlurred}}
736- <a href="#" {{action "syncData" on="click"}}>Save</a>
737- {{/if}}
738-
739- </fieldset>
740- </form>
741- </script>
724+ You can then use this view as a sub view and capture the events. In the following example, a change to the Name input would blur the form and cause the save button to appear.
725+
726+ ``` handlebars
727+ <form>
728+ <fieldset>
729+ <legend>Info:</legend>
730+
731+ {{view App.MyText name="Name" id="Name" valueBinding="myObj.Name"}}
732+ <label for="Name">Name</label><br/>
733+
734+ {{#if formBlurred}}
735+ <a href="#" {{action "syncData" on="click"}}>Save</a>
736+ {{/if}}
737+ </fieldset>
738+ </form>
742739```
0 commit comments