title: angular-ui-grid load state on controller creation
body: <p>I want to load the last state of a ui-grid when the controller is created.
  I've set up a plunkr. <a href="http://plnkr.co/edit/cOhLUUABVStfoTH6QVZd?p=preview" rel="nofollow">http://plnkr.co/edit/cOhLUUABVStfoTH6QVZd?p=preview</a>
  In my controller I use a restoreOnLoad function which is called immediately at the end of the controller. I get a TypeError: Cannot read property 'saveState' of undefined because the gridApi is undefined at the time of controller creation.</p>
  
  <pre><code>restoreOnLoad = function(){
    //retrieve stateinfo. For simplicity: inline object...
    var stateInfo = {
      "columns": [
          {
              "name": "",
              "visible": true,
              "width": 50,
              "sort": {
                  "direction": "asc",
                  "priority": 0
              },
              "filters": [
              ]
          },
          {
              "name": "M",
              "visible": true,
              "width": 50,
              "sort": {
              },
              "filters": [
              ]
          },
          {
              "name": "Company",
              "visible": true,
              "width": 200,
              "sort": {
              },
              "filters": [
              ]
          }
      ],
      "scrollFocus": {
      },
      "selection": {
      }
    }
    $scope.gridApi.saveState.restore($scope, stateInfo);
  }
  
  restoreOnLoad();
  </code></pre>
  
  <p>Any ideas how to avoid this error?</p>