я собираюсь связать модель с шаблоном с emberjsBinding модели шаблона с emberjs
<script type="text/x-handlebars" id="dashboard">
<div>
<span>this is user list</span>
<div>
{{render userinfo userinfo}}
</div>
</div>
</script>
<script type="text/x-handlebars" id="_userinfo">
{{#each model}}
<span>{{user}}
{{/each}}
</script>
App.Userinfo= DS.Model.extend({
user: DS.attr("string")
});
App.Userinfo.FIXTURES = [
{user:"user1"},
{user:"user2"},
{user:"user3"}
];
App.UserinfoView= Ember.View.extend({
});
App.UserinfoController = Ember.ObjectController.extend({
});
App.Router.map(function() {
this.resource('dashboard', {path: '/dashboard'}, function() {
});
});
App.DashboardRoute = Ember.Route.extend({
renderTemplate: function() {
this.render('dashboard', { // the template to render
controller: 'dashboard' // the controller to use for the template
});
}
});
App.DashboardController = Ember.ObjectController.extend({
});
Когда я иду к/#/приборной панели, шаблон приборной панели загружается.
Здесь я предоставил userinfo. Я хотел бы привязать модель Userinfo к шаблону usersinfo, чтобы отобразить всех пользователей. Помогите мне, пожалуйста.
Привет, спасибо. и затем я должен перейти на панель инструментов, когда я нажму кнопку входа в систему. поэтому я думаю, что мне не нужно использовать функцию, например, переход. как мне теперь делать это сейчас? –