4

I've followed the tutorial at http://docs.syncano.io/docs/angularjs but it only shows how to list class data from syncano.

syncano.class('CLASS').dataobject().list()
.then(function (res) {
    $scope.items = res.objects;
})
.catch(function (err) {
    console.log(err);
    $scope.error = err;
})

I've searched on how to add data as well. The only way that looks possible is using the api reference. Can anyone point me toward the right direction to accomplish this. And also for updating and deleting.

Zanon
  • 29,231
  • 20
  • 113
  • 126
philip_nunoo
  • 920
  • 3
  • 10
  • 21

1 Answers1

2

Looking at the doc, you can use

syncano.class('CLASS').dataobject().add(object)
      .then(function(res) {
        console.log(res);
      })
      .catch(function(err) {
        console.log(err);
      });
Bill Smith
  • 136
  • 1
  • 7
  • can you elaborate on where "account" is coming from. Remember i'm using angular and using the "syncanoService" library. So this doesn't help in anyway – philip_nunoo Mar 13 '16 at 16:08
  • it's just an example, you can use `dataobject().add(object)` to insert, so in your case it'd just be `syncano.class('CLASS').dataobject().add(object)` – Bill Smith Mar 13 '16 at 22:23