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>