Devi chappidi
Devi chappidi

Reputation: 196

Is there any alternative way for injecting our modules as dependencies while creating a module?

while creating a module we inject our dependencies after our modulename in[].Here am asking is there any possible way to inject our modules other than this way?

Upvotes: 3

Views: 36

Answers (2)

deepakchauhan
deepakchauhan

Reputation: 290

There is no other way to it. The only way is this. However you can use $inject when injecting controller dependencies. See here : https://docs.angularjs.org/guide/di

Upvotes: 1

devqon
devqon

Reputation: 13997

You can add dependencies by using the requires array:

var myApp = angular.module("myApp", []);

myApp.requires.push('newDependency');

Upvotes: 4

Related Questions