The Anubhav portal was launched in March 2015 at the behest of the Hon'ble Prime Minister for retiring government officials to leave a record of their experiences while in Govt service .
$routeProvider is simple URL-based routing suitable for small AngularJS apps, while
ui-router is a powerful state-based routing solution designed for complex applications with nested and multiple views.`
When to Use What?
Use $routeProvider:
Small apps
Simple navigation
One view per page
Use ui-router:
Enterprise apps
Nested layouts
Dashboards
Chat apps (like WhatsApp Web-style UI)
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Core Idea
/home)<ng-view>or<ui-view>$routeProvider(ngRoute)What it is
ngRouteHow it works
<ng-view>as the outletExample
Limitations
ui-router(AngularUI Router)What it is
ngRouteHow it works
Application is divided into states
Each state can have:
Uses
<ui-view>instead of<ng-view>ui-router Example
Key Differences:
$routeProvidervsui-router$routeProviderui-routerngRoute(core)ui.router(3rd-party)ng-viewui-viewInterview One-Line Summary
When to Use What?
Use
$routeProvider:Use
ui-router: