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
{{ message }}
This repository has been archived by the owner on May 29, 2019. It is now read-only.
When using the resolve options in modals, and the value to inject is a promise, it is not injected properly in the controller.
Basically, you are missing an else in the function getResolvePromises:
functiongetResolvePromises(resolves){varpromisesArr=[];angular.forEach(resolves,function(value){if(angular.isFunction(value)||angular.isArray(value)){promisesArr.push($q.when($injector.invoke(value)));}elseif(angular.isString(value)){promisesArr.push($q.when($injector.get(value)));}// If value is a promise, then what ?});returnpromisesArr;}
I would replace this with
functiongetResolvePromises(resolves){varpromisesArr=[];angular.forEach(resolves,function(value){if(angular.isFunction(value)||angular.isArray(value)){promisesArr.push($q.when($injector.invoke(value)));}elseif(angular.isString(value)){promisesArr.push($q.when($injector.get(value)));}elseif(angular.isObject(value)&&angular.isFunction(value.then)){promisesArr.push(value);}else{// We may need to push an empty value here since we rely on the order of the element// when doing:// ctrlLocals[key] = tplAndVars[resolveIter++];}});returnpromisesArr;}
The text was updated successfully, but these errors were encountered:
When using the
resolve
options in modals, and the value to inject is a promise, it is not injected properly in the controller.Basically, you are missing an
else
in the functiongetResolvePromises
:I would replace this with
The text was updated successfully, but these errors were encountered: