0
我正在创建一个小应用程序。我需要github表情符号来加载它。我正在使用restangular。 我设置restangular的baseUrl为:为什么我的Restangular对象是空的?
RestangularProvider.setBaseUrl('https://api.github.com');
我需要的是现在我想这是我一个数组中定义的表情符号的一些公司。那就是:
$scope.emojiNames = ['tokyo_tower', 'tongue', 'tractor', 'traffic_light', 'train', 'tiger', 'red_car'];
$scope.emojisObj = Restangular.one("emojis").get().
then(function(res) {
return ($scope.emojiNames).map(function(emoji) {
return res[emoji];
}, function(err) {
console.log("ERR:", err);
});
});
虽然安慰emojisObj
,它显示相应的URL值。
但在Html中绑定emojisObj
它显示为空。我在哪里犯错误?
我的HTML代码是:
<span ng-repeat="emoji in emojisObj track by $index">
<img ng-src="{{emoji}}" height="100px" width="100px"/>
</span>