title: Save gridster layout using angularjs
body: <p>I am creating dashboard application with Gridster: <a href="https://github.com/ManifestWebDesign/angular-gridster" rel="nofollow">https://github.com/ManifestWebDesign/angular-gridster</a></p>
  
  <p>I would like to save my layout to database using JSON. What I do know, is that I store charts array to database and fetch it. Is it possible to store widget col,row and size to specific widget so I could then give the size-x and size-y with angular style {{chart.xsize}}. When creating widget I could then assign default size values and save only after user has resized or dragged widget. Or is this completely wrong way to do this? How else I could store the widget sizes and positions to database?</p>
  
  <p>I have ng-repeat for my widgets like this:</p>
  
  <p></p>
  
  <pre><code>  &lt;div ng-if="chart.type === settings.types.LINEAR_GAUGE"&gt;
        &lt;div class="panel c8y" gridster-item size-x="2" size-y="1"&gt;
          &lt;div class="panel-heading"&gt;
            &lt;h3 class="panel-title"&gt;{{chart.title}}&lt;/h3&gt;
            &lt;button class="btn btn-danger pull-right btn-xs" ng-click="onClickDelete($index)"&gt;&lt;span class="glyphicon glyphicon-remove"/&gt;&lt;/button&gt;
          &lt;/div&gt;
          &lt;div class="panel-body"&gt;
            &lt;c8y-linear-gauge dp="chart.dp" measurement="chart.data[0].measurement"/&gt;
          &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p></p>