function processWidget(configFromApi, widgetConfig, dashboard) {
                // make sure widget has access to dashboard and config
                scope.dashboard = dashboard;
                scope.widgetConfig = widgetConfig;

                // when the widget registers and sets a 'getState' method use that
                // instead of the default logic to determine whether the widget should be loaded
                if (scope.widgetDefinition.getState) {
                    scope.state = scope.widgetDefinition.getState(widgetConfig);
                }
                else if (!configFromApi) {
                    if (scope.widgetDefinition.config) {
                        scope.state = WidgetState.CONFIGURE;
                    }
                }

                scope.init();
            }
// determine what state it's in based on the passed config and load accordingly
determine what state it's in based on the passed config and load accordingly
determine what state it ' s in based on the passed config and load accordingly
function processWidget(configFromApi, widgetConfig, dashboard) {
                scope.dashboard = dashboard;
                scope.widgetConfig = widgetConfig;
                if (scope.widgetDefinition.getState) {
                    scope.state = scope.widgetDefinition.getState(widgetConfig);
                }
                else if (!configFromApi) {
                    if (scope.widgetDefinition.config) {
                        scope.state = WidgetState.CONFIGURE;
                    }
                }
                scope.init();
            }
function processWidget ( configFromApi , widgetConfig , dashboard ) { scope . dashboard = dashboard ; scope . widgetConfig = widgetConfig ; if ( scope . widgetDefinition . getState ) { scope . state = scope . widgetDefinition . getState ( widgetConfig ) ; } else if ( ! configFromApi ) { if ( scope . widgetDefinition . config ) { scope . state = WidgetState . CONFIGURE ; } } scope . init ( ) ; }
determine what state it's in based on the passed config and load accordingly
determine what state it ' s in based on the passed config and load accordingly
// make sure widget has access to dashboard and config // when the widget registers and sets a 'getState' method use that // instead of the default logic to determine whether the widget should be loaded