m-e-conroy / angular-dialog-service

A complete AngularJS service with controllers and templates for generating application modals and dialogs for use with Angular-UI-Bootstrap and Twitter Bootstrap
MIT License
618 stars 227 forks source link

Angular translate inside modal #68

Closed aureliusm closed 10 years ago

aureliusm commented 10 years ago

Hi,

i'm having problems using custom translations inside modal with html template and controller. The error is:

Unknown provider: tanslateFilterProvider <- tanslateFilter

Dialog service default translations like YES, NO, OK work as expected, but any custom like {{ 'ADD_PAGE' | tanslate }} are not and error is thrown.

I call dialog.create like this

$scope.newSubItem = function ( var dlg = dialogs.create('pages/create/pages-create.html', 'PagesCreateController', {data:data}, {size: 'lg', keyboard: true, backdrop: true}); dlg.result.then(function (page) { $scope.children.push(page); $scope.updateServer(); }); };

Please help!

m-e-conroy commented 10 years ago

I'll take a look, but the first thing that comes to mind is if you remembered to either include Angular-Translate or if you used the translateProvider to set up a translation for 'ADD_PAGE'? If you include Angular-Translate make sure you also include the default translations module as well. I'm on vacation right now so I won't be able to look into this fully until mid-week.

aureliusm commented 10 years ago

Hi,

thanks for your quick response. I have included Angular Translate and included the default translations and everything is working fine. If I use 'ADD_PAGE' on a normal view, it works great, but if I call angular dialog like stated above, it doesn't work and returns that error.

Enjoy your vacation :) When you come back and have some time, please try to suggest something as I'm running out of ideas on what could be wrong.

Thanks!

m-e-conroy commented 10 years ago

Where did you add 'ADD_PAGE' to the translations?

aureliusm commented 10 years ago

Thanks for all your help. I have somehow managed to get it working, not even knowing when.