Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added fallback for continueOnError
Allow the Application to still get launched in order to handle the error gracefully.
Pass error into the module via same defined constant
  • Loading branch information
JannieP committed Apr 15, 2016
commit 311b32b1d274976bd54e4cce04fd514ebc3222ee
10 changes: 8 additions & 2 deletions src/deferred-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,14 @@ function bootstrap (configParam) {
}
}

function handleResults (results) {
function handleResults (results,error) {
forEach(results, function (value, index) {
var result = value && value.data ? value.data : value,
moduleName = constants[index].moduleName,
constantName = constants[index].name;

if (error){
result._error=error;
}
angular.module(moduleName).constant(constantName, result);
});

Expand All @@ -154,6 +156,10 @@ function bootstrap (configParam) {
if (isFunction(config.onError)) {
config.onError(error);
}
if (config.continueOnError){
handleResults (constants,error);
return doBootstrap(element, module, bootstrapConfig);
}
}

if (config.moduleResolves) {
Expand Down