ngRoute maps URLs to templateUrl and controller with $routeProvider.when.
Include 'ngRoute' in your module dependency array—the playground CDN loads angular-route.min.js.
Important interview questions and answers
- Q: Why does this matter?
A: ngRoute maps URLs to templateUrl and controller with $routeProvider.when.
Self-check
- Summarize ngRoute basics in one sentence.
- What would you try next in the playground?
Challenge
ngRoute basics hands-on
- Edit the default code.
- Click Run in browser.
- Confirm preview or terminal output.
Done when: preview or terminal matches the lesson goal.
Tip: Include ngRoute in the module dependency array—our playground CDN loads angular-route.min.js.
Interview prep
- What does ngRoute provide?
$routeProvider maps URLs to templateUrl + controller and renders into
ng-view.