Results 1 to 2 of 2

Thread: [AngularJS] Single or Multiple Service & Controller

  1. #1

    Thread Starter
    Lively Member FunkySloth's Avatar
    Join Date
    Aug 2016
    Posts
    91

    [AngularJS] Single or Multiple Service & Controller

    Hi Guys,

    I just want to know your insight about, is it good to put all functions and methods in a single controller and service of all my website modules or it is better to create one module equals to one controller and service using AngularJS.

    Thank you

  2. #2
    Lively Member
    Join Date
    Jan 2020
    Posts
    120

    Re: [AngularJS] Single or Multiple Service & Controller

    Hello,@FunkySloth

    Please try this code,To Single or Multiple Service & Controller

    Code:
    angular.module('myModule', [])
        .controller('MyController', [
            'Service1', 'Service2', 'Service3',
            function( Service1, Service2, Service3 ) {
              ...
            }
        ]);
    I hope this code will be useful for you.
    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width