Hello everyone, today I am going to share the very interesting when we play with services, factory and provider in angular. I notice an interesting point when I playing with providers . Here highlight the visibility of injectable. The services, factory and provider are injectable but the injectable is different for provider than from services and factory. I am going to a scenario, if you declare a constant(i.e. like angular.constant( 'baseUrl' , 'http://localhost:9669/' )), here you can inject into services, factories and providers. But when you declare a value (i.e. like angular.value( 'user' , {id: 'uid9669'} )), here you can inject into services and factories but not provider. The provider creating a $get function and then you can inject it. live demo click on link http://embed.plnkr.co/0EANoZ/preview For example over the injecting as given below. AngularJs code sample var app = angular.module( 'userApp'
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers