title: AngularJS, get scope with object-id
body: <p>Is it possible to get the specific scope of an object by accesing it through an ID?</p>
  
  <p>I use angular ui tree for a navigation menu. After I add a subitem and save the navigation into a mysql database, the node with the subitem is not expanded. 
  After the push, I see that the menu expands, but after saving it in the database and rerendering the navigation menu, the node is not expanded. </p>
  
  <p>Have someone a solution?</p>
  
  <p>JSON-Object of the menu.</p>
  
  <pre><code>[
    {
      "id": 35,
      "title": "foo",
      "items": []
    },
    {
      "id": 34,
      "title": "bar",
      "items": [
        {
          "id": 123,
          "title": "foobar",
          "items": []
        },
      ]
    },
    {
      "id": 46,
      "title": "barfoo",
      "items": []
    },
  ]
  </code></pre>
  
  <p>This structure is saved with the following code</p>
  
  <pre><code>function setMenu(nodeID) {
          $http.post("...", {
              "menuJSON" : $scope.menu
          }).success(function (data, status, headers, config) {
              if (status == 200) {
                  loadAdminNavigation();
              }
          });
      };
  </code></pre>
  
  <p>After saving it in the mysql database, the structure is reloaded with this code</p>
  
  <pre><code>function loadAdminNavigation() {
          $http.get("...").success(function (response) {
              $scope.menu = response;
          });
      };
  </code></pre>
  
  <p>If I add a SubItem, all scopes are new, I want to expand the node with the ID from the model. So I need to know how I can access the scope via the ID.</p>