Created
March 22, 2015 16:43
-
-
Save tofumatt/ba24f105b8dcd96e1064 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
i have key/value pairs stored via localforage by the main page, but i cant figure out how to bring up a list of keys for the about page. ng-repeat and ng-option dont seem to work, and i suspect it's because i'm not unwrapping my promises correctly? i dunno. | |
angular.module('scratchpadApp') | |
.controller('AboutCtrl', function ($scope, $localForage) { | |
var getKeys = function() { | |
localforage.keys() | |
.then(function(result) { | |
console.log(result); | |
$scope.getKeys = result; | |
}); | |
}; | |
}); | |
and the html | |
<ul> | |
<li>stuff</li> | |
<li ng-repeat="key in getKeys()">{{key}}</li> | |
</ul> | |
<select ng-model="foo" ng-options="key for key in getKeys()"</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment