You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property '0' of undefined scope.newFilm = scope.films[0];
presumably then, this hasn't run from upcomingfilms.controller.js $scope.films = allMovies;
is this an inherent issue to Angular? i wasn't sure why you have a 300ms timeout on functions. I assume it's related to everything running correctly in order.
is there a way to make one dependent on the other to avoid this error?
i console logged the various functions and it comes out like in this order, presumably meaning the nextfilm 300ms timeout is firing before the promise completes
MCU.directive.maincontentMCU.directive.maincontent.linkMCU.directive:nextfilmMCU.service:phasesServiceMCU.controller:upcomingfilmsControllerMCU.service:phasesService.getPhasesMCU.directive:nextfilm.linkMCU.directive.maincontent.link.timeoutMCU.directive:nextfilm.link.timeout// allMovies not set yet so errors...
TypeError: Cannotreadproperty'0'ofundefinedMCU.service:phasesService.getJson->deferredresolveMCU.controller:upcomingfilmsController.promise.thenMCU.controller:upcomingfilmsController.allMovies
Activity
jmp909 commentedon Dec 13, 2015
rather than put a timeout in the link function, this seems to work as an alternative to avoid the error
I'm pretty new to angular, so I'm not sure if this is the best approach
thanks
j