基于Ember.js的仪表板 [英] Ember.js based dashboard

查看:74
本文介绍了基于Ember.js的仪表板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ember.js开发应用程序,并使用spring MVC编写的休息API。我必须创建一个带有几个小部件的仪表板。每个widget都是自己的行为,并会调用不同的API方法。我正在考虑为每种窗口小部件设置一个控制器子类。然后将实例化它们,并将其视图添加到容器视图。但是,ember会自动为每个控制器创建一个实例,这是一个很好的路径吗?任何有关ember.js社区的建议?

I'm developing an application using ember.js and a rest API written with spring MVC. I have to create a dashboard with several widget on it. Every widget as its own behavior and will call different API method. I was thinking to have one controller subclass for each kind of widget. Then will instantiate them and will add ther views to a Container view. However ember will create a instance for each controller automatically, so is it a good path to follow? Any suggestion fom the ember.js community?

感谢您的帮助。

推荐答案

而不是每个小部件的插槽,我宁愿有一个小部件区域(列,...)的插槽,这将是一个 ContainerView ,根据用户的设置,我会动态添加小部件视图。

Rather than a slot for each widget, I would rather have a slot by widget area (column, ...), which would be a ContainerView, into which one I would dynamically add widgets views, according to user's settings.

这篇关于基于Ember.js的仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆