As described in AEM Page Templates, each component can output a JavaScript fragment to consume the JSON content exposed by the data promise. Following Angular conventions, a controller should only be used for assigning variables to the scope.