Skip to content

Instantly share code, notes, and snippets.

@YutaWatanabe
Created August 22, 2014 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YutaWatanabe/0f06c44ad757b523e950 to your computer and use it in GitHub Desktop.
Save YutaWatanabe/0f06c44ad757b523e950 to your computer and use it in GitHub Desktop.
Create and read items with Azure Mobile Service.
(function(){
// MobileServiceClient のインスタンスを作成
// URL, KEY は管理画面に表示されているものを貼り付け
var client = new WindowsAzure.MobileServiceClient(
"URL",
"KEY"
);
// Item テーブルのインスタンス取得
var itemTable = client.getTable("Item");
// Item テーブルに項目追加
itemTable.insert({ text:"Sample Item"});
// Item テーブルの項目を読出し
itemTable.read().then(function(items){
console.log(items);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment