Getting the DataSource Object

To access a DataSource defined in the current view:

var employeeDs = View.dataSources.get('employeeDs');
var records = employeeDs.getRecords();

Because all DataSource objects are auto-wired to controller data variables, you can simplify the code example above as follows:

var records = this.employeeDs.getRecords();