title: Angularjs/Ionic App json parsing
body: <p>In an ionic/angularjs app I want to parse the content of the following json file (generated by a server)</p>
  
  <pre><code> [
      {
          "raw": {
              "id": "2",
              "pid": "0",
              "sorting": "0",
              "tstamp": "1433706234",
              "Alias": "-2",
              "Menu1": "Test",
              "Menu2": "Test1",
              "From": "1433714400",
              "To": "1434060000",
              "Published": "1"
          },
          "text": {
              "Alias": "-2",
              "Menu1": "Test",
              "Menu2": "Test1",
              "From": "08.06.2015",
              "To": "12.06.2015",
              "Published": "1"
          },
          "attributes": {
              "Alias": "Alias",
              "Menu1": "Menu",
              "Menu2": "Menu",
              "From": "Datum From",
              "To": "Datum To",
              "Published": "Public"
          },
          "class": "first even"
      },
      {
          "raw": {
              "id": "1",
              "pid": "0",
              "sorting": "0",
              "tstamp": "1433706235",
              "Alias": "",
              "Menu1": "Test2",
              "Menu2": "Test21",
              "From": "1431295200",
              "To": "1431640800",
              "Published": ""
          },
          "text": {
              "Alias": "",
              "Menu1": "Test2",
              "Menu2": "Test21",
              "From": "11.05.2015",
              "To": "15.05.2015",
              "Published": ""
          },
          "attributes": {
              "Alias": "Alias",
              "Menu1": "Menu",
              "Menu2": "Menu",
              "From": "Datum From",
              "To": "Datum To",
              "Published": "Public"
          },
          "class": "last odd"
      }
  ]
  </code></pre>
  
  <p>I want to parse the data like this:</p>
  
  <pre><code>   .controller('GetJson', function ($scope, $http) {
          var obj = {content:null};      
          $http.get("test.json")
              .success(function (data) {
              obj.content = data;
          });
          return obj;
          $scope.all = obj;
          $scope.menu1 = obj.data.text.Menu1;
      });
  </code></pre>
  
  <p>And give it out:</p>
  
  <pre><code>&lt;ion-view view-title="test" ng-controller="GetJson"&gt;
  &lt;ion-content class="padding"&gt;
      {{all}}
      {{menu1}}
  &lt;/ion-content&gt;
  &lt;/ion-view&gt;
  </code></pre>
  
  <p>But that's not working. How do I get the data from the json?
  For example if I want to get: </p>
  
  <blockquote>
    <p>text->Menu1->"Test" or if I want to get attributes->Menu1->Menu</p>
  </blockquote>
  
  <p>Thanks for help in advance</p>
  
  <p><strong>EDIT:</strong>
  It works with this:</p>
  
  <pre><code>.controller('GetJson', function ($scope, $http) {
  
      $http.get("test.json")
          .success(function (data) {
          $scope.all = data;    
          $scope.menu1 = data[0].text.Menu1;  
      });   
  })
  </code></pre>