Ember.js Control Panel

I am developing an application using ember.js and a leisure API written using spring MVC. I need to create a control panel with several widgets. Each widget is as its own behavior and is called by a different API method. I thought of having one controller subclass for each kind of widget. It will then instantiate them and add them to the container view. However, ember will automatically create an instance for each controller, so is this a good way to follow? Any suggestion for fom to the ember.js community?

Thanks for the help.

+4
source share
2 answers

Instead of a slot for each widget, I would prefer to have a slot in the widget area (column, ...), which would be a ContainerView , into which I would dynamically add widget views according to user preferences.

+4
source

Your ideas sound good.

There are many ways to structure this. Perhaps I suggest making a DashboardView and a DashboardController, and in my template several outputs , one for each widget "slot":

 {{outlet topWidgetView}} {{outlet leftWidgetView}} ... 

Then, in the router, in the connectOutlets route connectOutlets the control panel, connect the widgets after creating the toolbar instance:

 router.get('applicationController').connectOutlet('dashboard'); router.get('dashboardController').connectOutlet({ outletName: 'topWidgetView', name: 'fooWidget' }); router.get('dashboardController').connectOutlet({ outletName: 'leftWidgetView', name: 'barWidget' }); 
+5
source

Source: https://habr.com/ru/post/1439594/


All Articles