-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
Unfortunately when I try to edit an existing exercise it cant load that in exercise template page, but after I editing code such as it return the promise and resolving the promise in init() function solve my problem. I think the code here really needs modification:
var init = function () {
// We do not use the resolve property on the route to load exercise as we do it with workout.
$scope.exercise = ExerciseBuilderService.startBuilding($routeParams.id);
};
And Here:
service.startBuilding = function (name) {
//We are going to edit an existing exercise
if (name) {
buildingExercise = WorkoutService.Exercises.get({ id: name }, function (data) {
newExercise = false;
});
}
else {
buildingExercise = new Exercise({});
newExercise = true;
}
return buildingExercise;
};
we should consider using $promise and using it after resolution at init() function using then call back Function
Metadata
Metadata
Assignees
Labels
No labels