title: Correct format for routing by Id in AngularJS
body: <p>I am using the following route in AngularJS:</p>
  
  <pre><code>  .when("/content/:id", {
      templateUrl : "templates/content.html",
      controller : "content"
    })
  </code></pre>
  
  <p>and the following controller:</p>
  
  <pre><code>app.controller('menu', function($scope, $http) {
      $http.get('api address')
      .then(function(response) {
          scope.navi = response.data.body;
          $scope.selectCourse = function(course, index, path) {
              location.href=path
              $scope.content = response.data.body[index]
          };     
      });
  });
  </code></pre>
  
  <p>The controller generates the templateURL in the following format:</p>
  
  <pre><code>#!content/2  //where '2' is a dynamic variable that changes with each menu item
  </code></pre>
  
  <p>Here is my question:</p>
  
  <p>Is this the correct format for using a variable in the templateUrl?</p>
  
  <pre><code>"/content/:id"
  </code></pre>
  
  <p>Currently each menu item goes to:</p>
  
  <pre><code>http://127.0.0.1:5500/index.html#!/content/1
  http://127.0.0.1:5500/index.html#!/content/2
  http://127.0.0.1:5500/index.html#!/content/3
  </code></pre>
  
  <p>But the content isn't changing in the template as needed. BTW, everything works as needed in console.log, which is why Im thinking I have a simple formatting or syntax issue in the way Im formatting the link(s).</p>