Javascript 在ember.js中查看处理程序

Javascript 在ember.js中查看处理程序,javascript,ember.js,Javascript,Ember.js,//我的表单视图 App.Form = Em.View.extend({ templateName:'app/templates/Login/login' }); //Index.html <script type="text/x-handlebars"> Hello <b>{{App.Value}}</b> <div id="frm"> {{#view App.Form}}

//我的表单视图

App.Form = Em.View.extend({
    templateName:'app/templates/Login/login'    
});
//Index.html

<script type="text/x-handlebars"> 
    Hello <b>{{App.Value}}</b>  
       <div id="frm">
            {{#view App.Form}}

        {{/view}}
       </div>                   
</script>   

你好{{App.Value}}
{{{#查看App.Form}
{{/view}
//车把

<b>Login Page: </b>
登录页面:
几个问题

  • 当我加载index.html时,它不会调用登录手柄。我看不到外面粗体的文字
  • 在我打了一个ajax电话检查我的凭证之后,如何将我的用户重定向到另一个视图或页面
    App.Form=Em.View.extend({
    模板名称:'loginTemplate'
    });
    登录页面:
    

    我猜应该是这样的……为了重定向到页面,你可以试试Ember.Router

    你能发一把小提琴吗?问题很不清楚你想做什么模板在这里做什么。你能给我举个例子吗?我从loginTemplate.handlebar中读取了一些内容,并在index.html中的处理程序中显示出来
    App.Form = Em.View.extend({
        templateName:'loginTemplate'    
    });
    
    <script type="text/x-handlebars" data-template-name="loginTemplate"> 
      <b>Login Page: </b>
    </script>