0
onecontact created
Hi, trying to opening a modal with a function on resolve:
vm.searchDocument = function () {
var modalDoc = $uibModal.open({
templateUrl: '~/App/tenant/views/search/index.cshtml',
controller: 'tenant.views.search.index as vm',
backdrop: 'static',
resolve: {
docType: function () {
return "01";
}
}
});
modalDoc.result.then(function () {
//return something
});
};
appModule.controller('tenant.views.search.index', [
'$rootScope', '$scope', 'abp.services.app.sales', 'uiGridConstants', 'docType',
function ($rootScope, $scope, salesService, uiGridConstants, docType) {
var vm = this;
console.log(docType);
In the console I can see : 01 but after that this error appear:
https://docs.angularjs.org/error/$injector/unpr?p0=docTypeProvider%20%3C-%20docType%20%3C-%20tenant.views.search.index
what are wrong?
thanks for you help
3 Answer(s)
-
0
Hi,
Your code seems correct. Does it work when you comment out the lines after ?
console.log(docType);
Thanks.
-
0
Hi, was our error, declaring the controller in html and in the open method of modal, are fine now removing the controller in the html page, thank you
-
0
Hi @junior1986,
Thanks for the feedback.