What is the difference between angular-route and angular-ui-router?

ui-router is a 3rd-party module and is very powerful. It supports everything the normal ngRoute can do as well as many extra functions. Here are some common reason ui-router is chosen over ngRoute: ui-router allows for nested views and multiple named views. This is very useful with larger app where you may have pages that … Read more

Delaying AngularJS route change until model loaded to prevent flicker

$routeProvider resolve property allows delaying of route change until data is loaded. First define a route with resolve attribute like this. angular.module(‘phonecat’, [‘phonecatFilters’, ‘phonecatServices’, ‘phonecatDirectives’]). config([‘$routeProvider’, function($routeProvider) { $routeProvider. when(‘/phones’, { templateUrl: ‘partials/phone-list.html’, controller: PhoneListCtrl, resolve: PhoneListCtrl.resolve}). when(‘/phones/:phoneId’, { templateUrl: ‘partials/phone-detail.html’, controller: PhoneDetailCtrl, resolve: PhoneDetailCtrl.resolve}). otherwise({redirectTo: ‘/phones’}); }]); notice that the resolve property is defined … Read more