You are not injecting $routeParams
to your controller. Inject it to your controller like:
app.controller("UserDetailCtrl", function($scope, $routeParams) {
This will solve your issue
In your controller you named the scope variable as $scope.name2
and in your partial2.html page you are binding to {{name}}
. That is the problem. Change it to {{name2}}
or either change your scope variable to $scope.name