I am working with multiple routes in my application:
routes.js
$routeProvider.when(
'/dashboard/one',
{
templateUrl: 'partials/dashboard.html',
controller: 'DashboardCtrl'
});
$routeProvider.when(
'/dashboard/two',
{
templateUrl: 'partials/dashboard.html',
controller: 'DashboardCtrl'
});
The content of my dashboard.html is as follows:
...
<ng-include src="dashboardPath"></ng-include>
...
I need the SRC attribute of the ng-include
element to dynamically change based on the route. For instance, I want the dashboardPath
to be set as one.html
when the current route is /dashboard/one
. How can I achieve this dynamic binding between the route URL and the src
attribute?