How to combine more JS files into one file in AngularJS?

330 views
Skip to first unread message

Siva Kumar

unread,
Oct 31, 2013, 2:48:44 AM10/31/13
to ang...@googlegroups.com

I have 3 module names 'dashboard.services1,' , 'dashboard.services2', 'dashboard.services3' .

angular.module('dashboard.services1', [])

.service('sublineService', function ()

 that 3 services are .js (angular) files. these files i want to add in

app.js

angular.module('dashboard', ['dashboard.filters', 'dashboard.services1', 'dashboard.services2', 'dashboard.services3', 'dashboard.directives', 'dashboard.controllers']).

  config(['$routeProvider', function ($routeProvider, $routeParams) {

      // Dashboard Screens

      $routeProvider.when('/lines', { templateUrl: 'partials/lines.html', controller: 'PlantController' });

      $routeProvider.when('/lineId/:lineId/linename/:linename', { templateUrl: 'partials/line-detail.html', controller: 'LineDetailController' });

      $routeProvider.when('/subline/:lineId/:sublineId', { templateUrl: 'partials/subline-detail.html', controller: 'SublineController' });

      $routeProvider.when('/equipment/:equipmentId', { templateUrl: 'partials/equipment-detail.html', controller: 'EquipmentController' });

 $routeProvider.otherwise({ redirectTo: '/lines' });

  }]);

but my problem is not working all these 3 files. Last one i.e

 'dashboard.services3'

only working and getting output from these. Other 2  module names were skipped. I dono want is my problem here.

My question is how to add more service files (i.e. module names ) / how to combine those module names into single .js (angular)  file to get all scripts files were want to work out and get my output..



Thanks !

Priya Bose

unread,
Oct 31, 2013, 7:19:11 AM10/31/13
to ang...@googlegroups.com
hi can you post the code using plunker or in jsfiddle???
so that i my help you
Reply all
Reply to author
Forward
0 new messages