Create an Apex Controller Class in the Force.com IDE

Create a class to access data from contacts.
  1. If you don’t already have an Eclipse project for this org, complete the steps in Create a Force.com Project.
  2. To save changes to the server automatically, right-click the name of the project that you created, then select Force.com | Work Online. When Work Online is enabled, the icon next to your project name looks like this: Work Online icon, rather than like this: Work Offline icon. Working online can lead to long save times, but your Developer Edition org probably has a small codebase, so save times aren’t a concern.
  3. Right-click your project in the Package Explorer, then select New | Apex Class.
  4. Enter MyContactListController in the Name field, and then click Finish.
  5. In the body of the class, between the {} braces, enter this code.

    @AuraEnabled enables client- and server-side access to the controller method.

  6. To save your updated class, press Ctrl+S or (Cmd+S on macOS).