Being a novice in AngularJs, I have a query regarding the controller structure.
This particular file is my employeeController.js
(function()
{
angular.module('employeeApp').controller('employeeController', employeeController);
function employeeController(employeeFactory,$routeParams,departmentFactory,schoolFactory,mentorFactory,constants,$location,$scope) {
var vm = this;
// other code here...
}
In my angular controller file, I have included two methods called editEmployee
and createEmployee
at the end of the file. I use these methods on both the 'create employee' page and the 'edit employee' page to load combobox values. For instance, on the 'create employee' page, I call
ng-init="employeeController.createEmployee()"
to populate those comboboxes.
Realizing that this may not be the most efficient way to handle this task, I am seeking suggestions on how to improve this process?