title: Angular JS, how to pass URL parameters to $resouce in angularJS?
body: <p>Hi I have a simple controller where it passes unique integers into my url, but Im running to many issues. I need to change this "4401" dynamically from my controller.</p>
  
  <p>the url Im trying to reach:
  <a href="https://itunes.apple.com/us/rss/topmovies/limit=50/genre=4401/json" rel="nofollow">https://itunes.apple.com/us/rss/topmovies/limit=50/genre=4401/json</a></p>
  
  <pre><code>app.factory('classic',function ($resource) {
  
      return $resource('https://itunes.apple.com/us/rss/topmovies/limit=50/genre=:id/json', {
          get: {
              method: 'JSONP',
              id: '@id'
          }
      });
  
  });
  </code></pre>
  
  <p>and here is my controller</p>
  
  <pre><code>app.controller('TestCrtl', function ($scope, classic) {
      init();
      function init(id) {
          $scope.movies = classic.get(id);
      }
      $scope.classicMovies = function(){
          var id = "4403";
          init(id);
      }
  
  
      $scope.anctionMovies = function(){
          var id = "4404";
          init(id);
      }
  });
  </code></pre>
  
  <p>The error Im getting
  Uncaught SyntaxError: Unexpected token :</p>
  
  <p>any help would be highly appreciated.</p>
  
  <pre><code> &lt;div class="col-sm-4"&gt;
              &lt;button type="button" data-ng-click="actionMovies()" class="btn btn-default"&gt;Action&lt;/button&gt;
          &lt;/div&gt;
          &lt;div class="col-sm-4"&gt;
              &lt;button type="button" class="btn btn-default"&gt;Scary&lt;/button&gt;
          &lt;/div&gt;
  </code></pre>