Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

AngularJS - Modal error

I'm getting the following error when trying to load a modal in my app.

angular.js:13236 Error: [$injector:unpr] http://errors.angularjs.org/1.5.0/$in...
at Error (native)
at https://appery.io/app/view/db9e0dc0-a...
at https://appery.io/app/view/db9e0dc0-a...
at Object.d [as get] (https://appery.io/app/view/db9e0dc0-a...)
at https://appery.io/app/view/db9e0dc0-a...
at Object.d [as get] (https://appery.io/app/view/db9e0dc0-a...)
at A.get (https://appery.io/app/view/db9e0dc0-a...)
at Object. (https://appery.io/app/view/db9e0dc0-a...)
at Object.invoke (https://appery.io/app/view/db9e0dc0-a...)
at Object.$get (https://appery.io/app/view/db9e0dc0-a...)

I have another app that works fine. I did notice that the working app uses Libraries version v1.0 and the error app uses Libraries version v1.1.

The modal is created and listed under Modals.

Here's my code:

Apperyio.get('Modals').loadModal("Indemnity").then(
function(modal){
modal.scope.current_item = {
// Set input object for send to modal window
// Value: .itemFromModal
};

modal.scope.modalInstance = modal.open({
// Optional settings:
size: 'lg', /* 'lg' | 'sm' /
backdrop: true, / true | false | 'static' /
keyboard: true, / true | false /
backdropClass: '', / backdropClass name /
windowClass: '', / additional CSS class(es) to be added to a modal window template /
windowTemplateUrl: '' / a path to a template overriding modal's window template */
});

modal.scope.modalInstance.result.then(
function(current_item){
// Custom implementation with modal response with current_item
},
function(error){
console.log(error);
}
);
});

Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

AngularJS - Modal error

I have created another app from a backup and changed the Libraries version to v1.0.

Error still happening.

Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

AngularJS - Modal error

According to AngularJS: This error results from the $injector being unable to resolve a required dependency. To fix this, make sure the dependency is defined and spelled correctly.

See: https://docs.angularjs.org/error/$inj...

How can I do this manually to troubleshoot?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

AngularJS - Modal error

Could you clarify have you changed anything on the Source tab?

If you did, these custom changes might cause the build to fail. Try to rollback the custom source changes and try to build the app again. Here is how to rollback custom source change: https://docs.appery.io/docs/appbuilde...

When you make changes in the Source view for a particular page, the visual editor for that page will not be updated (until you rollback the changes).

Please provide us with a public app link (https://docs.appery.io/docs/testingan...) and exact steps to reproduce this problem.

Return to “Issues”