Created
October 27, 2010 03:01
-
-
Save mhevery/648351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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