What are the difference between @injectable() vs. @Inject() in angular 2?



What are the difference between @injectable() vs. @Inject() in angular 2?..

Answer / Himanshu Verma

The @Injectable() decorator is used to mark a class as an injectable service, allowing it to be provided by Angular's dependency injection system. The @Inject() decorator is used within the constructor of a class to specify the dependencies that need to be injected.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

Is angularjs a framework?

1 Answers  


How can you decrease the digest cycle time?

1 Answers  


What is angular good for?

1 Answers  


What is angular subscribe?

1 Answers  


What do you mean by data binding?

1 Answers  


What is ng-switch in angularjs?

1 Answers  


What is SPA (Single Page Application) in AngularJS?

1 Answers  


Who created angular?

1 Answers  


What is the use of interceptors in angular?

1 Answers  


What is @input and @output in angular?

1 Answers  


What do you understand by constants in angular?

1 Answers  


Explain the concept of scope. How does scope inheritance work in angularjs?

1 Answers  


Categories