mardi 29 septembre 2015

Emberjs: In my template I can't get a value from a form my controller

I create a template and it's controller and i set a variable(value) in controller but when i try to access in template noting to happen. my controller is:

    App.AboutController = Ember.Controller.extend({
    info:null,
    init: function() {
        console.log("yes i am in About controller");
        info = post["about"];
    },
  actions: {
    getdata1:function(data){
    console.log("aa gaya",data);
    info = post[data];
    console.log(info);
    }

  }

and Template is:

<script type="text/x-handlebars" id="about" data-template-name="about">
<div class="col-xs-6 middlesubBody">
               {{info}}
           </div>
            <div class="col-xs-3 rightsubBody">
                <div id="column">
                        <div
                        {{action "getdata1" "about"}}> About</div>
                        <div>
</div>
</script>

MY Action is working fine but info value is not set to template.i want to dynamic binding . I think i am wrong but i don't know where is problem.




Aucun commentaire:

Enregistrer un commentaire