Angularjs difference between routeprovider and stateprovider

angularjs

In this blog we have described the main differences between routeprovider and stateprovider in angularJS. Here you can learn the reason why to use ui-router over ngRoute becuase ui-router is used to enhance and to improve the capabilities of routing

$route: This is used for deep-linking URLs to controllers and views (HTML partials) and watches $location.url() in order to map the path from an existing definition of route.

When we use ngRoute, the route is configured with $routeProvider and when we use ui-router, the route is configured with $stateProvider and $urlRouterProvider.

ngRoute – It is a part of AngularJs and was developed by Angular.js team.

Syntax:

  1. <div ngview></div>
  2. $routeProvider
  3. .when(‘/contact/’, {
  4. templateUrl: ‘app/views/core/contact/contact.html’,
  5. …..

Read Full Blog : Angularjs difference between routeprovider and stateprovider

You can also post and view C, PHP, JAVA, HTML, iOS and Android questions and answers at FindNerd’s community forum.

Advertisements
Angularjs difference between routeprovider and stateprovider

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s