We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    ¶ms=


    needs to be

    &params=


    corrected it in the code above.
    Also, the link to my example setup should work again.
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 33657
      • 128 Posts
      Quote from: Bruno17 at Apr 27, 2014, 12:53 AM
      ¶ms=


      needs to be

      ¶ms=


      corrected it in the code above.
      Also, the link to my example setup should work again.


      if you goto http://www.revo222.webcmsolutions.de/75/angular-spa/ajax/content.html?root=/75/angular-spa/book/gatsby&params={%22bookId%22:%22gatsby%22}

      you will see a correct dump of what I want. your site works. Mine.. does not.

      http://za.hostwarp.com/json?root=/about¶ms={%22key%22:%22value%22,%22id%22:%22whatever%22}

      when I try and replicate that it does not give me anything back...

          function ContentCtrl($scope, $routeParams, $http, $location) {
      $http({method: 'GET', url: '[[~4]]?root=' + $location.path() + '¶ms=' + angular.toJson($routeParams)}).
                    success(function(data, status, headers, config) {
                        if(data){
                            $scope.title = data.pagetitle || '';
                            $scope.items = data.items || [];      
                        }
                  }).
                    error(function(data, status, headers, config) {
                    // called asynchronously if an error occurs
                    // or server returns response with an error status.
                  });   
          }


      and URL [[~4]] is suppose to be a empty template page with
      http://za.hostwarp.com/json


      and inside that it contains
      [[!getResourceToJson]]


      Something isn't firing correctly. How do i get my json page to give me back all those keys like your link does??? is there an addon I am missing or a step I am not getting correctly? [ed. note: zurie last edited this post 12 years, 5 months ago.]
        • 4172
        • 5,888 Posts
        my test-setup is, allways to have a ending slash '/' at the url.

        your's is without.
        I've changed the example-snippet to test for both, with and without ending slash.
        As allready said, this snippet is just a very basic one, just to get started and to see how this could work.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 33657
          • 128 Posts
          Quote from: Bruno17 at Apr 27, 2014, 09:49 AM
          my test-setup is, allways to have a ending slash '/' at the url.

          your's is without.
          I've changed the example-snippet to test for both, with and without ending slash.
          As allready said, this snippet is just a very basic one, just to get started and to see how this could work.

          Thank you so much! This is a great way to build the json for a modx file because believe it or not I was manually creating a json file with get resources and it was a chore.