For example there is a file service.js there is a file app.js
app.js:
var app = angular.module('myApp'); app.controller('MainCtrl', function(myService,$scope){ $scope.value = myService.value; }); service.js
app.factory('myService', function(){ return{ value: 1 } }); How to physically link these files so that the service was visible from the controller (since in this form the service from the controller is not available, it gives an error). Is it necessary to use collectors, or is it done somehow differently "automatically")) sorry for the children's question. Thank!
service.jshtml afterapp.jsand everything will work. If there is no such file, then the error will be when executing app.js - about the impossibility of getting a module. - Grundy