First page Back Continue Last page Overview Image
{WidgetName}.js controller Function
- The “controller” section of this file acts like a constructor and gets called when the Directive is initializing. At this point in time, it has not been added to the DOM yet.
- Use this section initialize any variables and define any functions for your Widget. Always define these on $scope, because Angular creates a $scope for each instance of your Widget.
- Also in this section is where you will load any translation files for your Widget. If you don’t have any, just comment out the code to load them so the browser won’t try and load them.