technomark.in
Hot News

$(this) Selector And Children / Find In jQuery

Detect An Undefined Object Property In JavaScript

Rotate And Save Video Using VLC Media Player

Capitalize The First Letter Of String In JavaScript

Convert Any Files To Any Format Using VLC Media Player

Asp.Net AngularJS WCF IIS
DataBase Jquery Bikes Random
HomeContact Us Watch Our YouTube Channel ..........Blog Spot..........

Technomark.in

How To Logout From All Devices In Skype

Technomark.in

How To Embed Google Map In Your Code

Technomark.in

How To Install IIS (Internet Information Services) On Windows

Technomark.in

Enable Directory Browsing In IIS

View All


Difference Between AngularJS Module Factory, Service And Provider


Factory Vs Service Vs Provider In AngularJS

> First of all lets consider the Difference among Factory, Service and Provider.
> Factory Returns the Function's Return Value.
> Provider Returns the output of the Function's $Get Function.
> Service Returns the Actual Function.
> We explain on the basis of return value of each of them.
> Lets Consider a common function as shown below.
> This function will be used in common for Factory, Service and Provider demo.

Difference Between AngularJS Module Factory Service And Provider, Factory Vs Service Vs Provider In AngularJS, Difference Between AngularJS Module Factory And Provider, Difference Between AngularJS Module Service And Provider, Difference Between AngularJS Module Factory And Service

Factory In AngularJS

Difference Between AngularJS Module Factory Service And Provider, Factory Vs Service Vs Provider In AngularJS, Difference Between AngularJS Module Factory And Provider, Difference Between AngularJS Module Service And Provider, Difference Between AngularJS Module Factory And Service

> Syntax: module.factory( 'factoryName', function );
> Factory Returns the Function's Return Value.
> Here the Function's name is demoFunction
> The function's return value is Output from Factory is : Technomark.In.
> We use double curly bracket for displaying the output as shown below.

{{ FactoryResult }}



> The Result will be as follows on the browser.

This is From Factory : Output from Factory is : Technomark.In


> That means we get the function's return value on the factory.

Services In AngularJS



> Syntax: module.service( 'serviceName', function );
> Service Returns the Actual Function.
> Here the Function's name is demoFunction
> We use double curly bracket for displaying the output as shown below.

{{ ServiceResult }}



> The Result will be as follows on the browser.

This is From Service : [object Object]


> That means, Service Returns the Actual Function..

Provider In AngularJS

Difference Between AngularJS Module Factory Service And Provider, Factory Vs Service Vs Provider In AngularJS, Difference Between AngularJS Module Factory And Provider, Difference Between AngularJS Module Service And Provider, Difference Between AngularJS Module Factory And Service

> Syntax: module.provider( 'providerName', function );
> Provider Returns the output of the Function's $Get Function .
> Here the Function's name is demoFunction
> The function's $get function's return value is Output from Provider is : Google.com.
> We use double curly bracket for displaying the output as shown below.

{{ ProviderResult }}



> The Result will be as follows on the browser.

This is From Provider : Output from Provider is : Google.com


> That means, Provider Returns the output of the Function's $Get Function .

Watch Video of this Content on Video Streaming

Post Your Comment

Name *


Email *


Comment * Please provide all three fields for posting Comment




Technomark.in

Book Train Tickets on IRCTC Quickly During Tatkal Period

Technomark.in

Before You Copy Any Image From Internet

View All

Privacy StatementDisclaimerSitemap