Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
feat(translateService): removes empty options object requirement for …
Browse files Browse the repository at this point in the history
…loaders

currently, when using custom loaders for asynchronous loading,
you have to at least pass an empty options object to
useLoader(..).

now, when this comes in, you can leave it off when don't need
any optional options for you custom laoder
  • Loading branch information
0x-r4bbit committed Jun 21, 2013
1 parent 525b353 commit c09d1db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
*/
this.useLoader = function (loaderFactory, options) {
$loaderFactory = loaderFactory;
$loaderOptions = options;
$loaderOptions = options || {};
};

/**
Expand Down
2 changes: 1 addition & 1 deletion test/unit/translateServiceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ describe('pascalprecht.translate', function () {

beforeEach(module('pascalprecht.translate', function ($translateProvider, $provide) {

$translateProvider.useLoader('customLoader', {});
$translateProvider.useLoader('customLoader');

$provide.factory('customLoader', ['$q', '$timeout', function ($q, $timeout) {
return function (options) {
Expand Down

0 comments on commit c09d1db

Please sign in to comment.