What happen when I import the same module twice?



What happen when I import the same module twice?..

Answer / Shiwali Gupta

Importing the same module twice in AngularJS will not cause any errors. However, it may result in duplicate services or directives if they are not properly configured as singletons. To avoid this, you should make sure that your services and directives are declared as singletons using the `.service('serviceName', function(){...})` or `.directive('directiveName', function(){...})` syntax.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What is activatedroute in angular?

1 Answers  


What is bundle js in angular?

1 Answers  


What do you understand by dependency injection in angularjs?

1 Answers  


What is the difference between angularjs 4 and angularjs?

1 Answers  


Explain uppercase filter?

1 Answers  


What is ddo (directive definition object)?

1 Answers  


What is export array in angular 2?

1 Answers  


What is a service angular?

1 Answers  


How do you interact between two components?

1 Answers  


What are the differences between service and factory methods?

1 Answers  


What is lazy loading in angular?

1 Answers  


What are Expressions in AngularJS?

1 Answers   SLK Software,


Categories