angularjs - Is there a way to define service on controller only -


i have global set angular app module:

var app = angular.module('app', [], function ($interpolateprovider) {     //$interpolateprovider.startsymbol('<%');     //$interpolateprovider.endsymbol('%>'); }); 

i include in pages angular stuff.

i have controller loaded on page requires service called 'angularfileupload':

app.controller('fileuploadcontroller', ['$scope', 'fileuploader', function ($scope, fileuploader) { 

if place service inside module array, works fine. there way of attaching controller instead... means not have load script files every page using module regardless of if controllers require angularfileupload service or not.

edit: regarding last comment

if declare:

var app = angular.module('app'); 

how add service module?


Comments

Popular posts from this blog

c# - ItextSharp font color issue in ver 5.5.4+ -

jquery - Multiple issues with pushstate: history, loading, calling functions -

ios - retrievePeripherals deprecated in IOS7 how to substitude it with retrievePeripheralsWithIdentifiers -