Skip to content

Instantly share code, notes, and snippets.

@mhevery
Created October 27, 2010 03:01
Show Gist options
  • Save mhevery/648351 to your computer and use it in GitHub Desktop.
Save mhevery/648351 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html xmlns:ng="http://angularjs.org">
<head>
<script type="text/javascript"
src="http://code.angularjs.org/angular-0.9.0.js" ng:autobind></script>
</head>
<body>
<script>
function FetchCtrl() { }
FetchCtrl.prototype =
{
fetchsheets: function()
{
var self = this;
self.sheets = [];
self.sheets[0] = {};
self.sheets[0].$sheetId = "od1";
self.sheets[0].$title = "Sheet1";
self.sheets[1] = {};
self.sheets[1].$sheetId = "od2";
self.sheets[1].$title = "Sheet2";
},
deletesheet: function()
{
var self = this;
self.sheets.splice(0,1);
}
};
</script>
<div ng:controller="FetchCtrl">
<button ng:click="fetchsheets()">fetch</button>
<br />
<select name="worksheet">
<option ng:repeat="sheet in sheets" value={{sheet.$sheetId}}>{{sheet.$title}}</option>
</select>
<br />
<br />
option={{worksheet}}
<br />
<button ng:click="deletesheet()">delete</button>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment