Is there any way to do code grouping using partials in angularjs?
Reason --- I have a controller which contains too much code. This controller contains the code For several Methods and a lot of functionalities, it reduces the readability of the code. I want to keep controller name the same and do code grouping.
Ex:-
app.controller('MainController', function ($scope, router) {
$scope.Read = function() {
};
$scope.Write = function() {
};
$scope.Update = function() {
};
$scope.Delete = function() {
};
});
Partial:
app.controller('MainController', function ($scope, router) {
$scope.firstName = firstname;
$scope.middleName = middleName;
$scope.lastName = lastName;
});
Another Partial:
app.controller('MainController', function ($scope, router) {
$scope.Print = function() {
};
$scope.PrintPreviw = function() {
};
});
I need to implement it like this.
Is there any other way? yes please update.. Thanks