0

My promise seem to not be resolving when I try to pass it directly to my view, It works when I go through the .then method.

Example here http://jsbin.com/oworucAL/1/edit

Andrew Smith
  • 1,224
  • 6
  • 9
  • By changing the AngularJS version, you'll see that the data comes in on Angular 1.0.x & 1.1.x, but not in 1.2.1. – Sean O Nov 20 '13 at 16:22
  • Answer can be found in this SO thread: http://stackoverflow.com/questions/19472017/angularjs-promise-not-binding-to-template-in-1-2 – user2643882 Nov 20 '13 at 16:55

1 Answers1

0

GetData return a promise, and you must manage it.

app.controller('RepeatController', function ($scope, DataFactory) {
     DataFactory.getData().then( function(data){ 
     $scope.weeks = data; }, 
     function (){}); 
 })  ;

http://jsbin.com/iYApuFE/1/edit

evoratec
  • 59
  • 1
  • 3