How routing works in AngularJS? Difference between $routeProvider and ui-router.
122
29-Dec-2025
Updated on 29-Dec-2025
Anubhav Kumar
29-Dec-2025Core 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: