If the link seems to complex, a simple way is to move some generic
functions to services and include those services in your controller..
Ex:
//Create a new service
myapp.service('myService1', function(){
var returnService = {};
returnService.fun1 = function(para1, para2){
// copy paste your process
return processedData;
}
return returnService;
}
// Include that service in controller
myapp.controller('firstCntrl', ['$scope', 'myService1', function($scope,
myService1){
$scope.processedData = myService1.fun1($scope.para1, $scope.para2);
});
You can create n number of services as per your logic. Hope this helps and
simplifies the look
On Friday, August 22, 2014 10:00:11 AM UTC+10, kishorekumaru wrote:
>
> Hi I am not sure this helps
> <http://weblogs.asp.net/dwahlin/dynamically-loading-controllers-and-views-with-angularjs-and-requirejs>
>
> On Friday, August 22, 2014 9:39:29 AM UTC+10, Michael Giambalvo wrote:
>>
>> Back at ngConf, Rachel Dale gave a talk on organizing large angular
>> applications, in which she mentioned her team likes to use "Helper
>> Controllers" in addition to services.
>> https://www.youtube.com/watch?v=62RvRQuMVyg#t=1271
>>
>> I'm wondering what the general opinion on this technique is? I have a
>> couple big controllers in my app that I'd like to break into smaller units,
>> and I'm trying to figure out how to organize and have them communicate with
>> each other. Having one controller instantiate another seems like it would
>> solve a few of my problems, but I wonder what other problems it would
>> create.
>>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.