From 182044ffa60ba7d48e4a4682e9439e90b0bc0236 Mon Sep 17 00:00:00 2001 From: Pius Nyakoojo Date: Fri, 7 Oct 2016 21:55:51 -0500 Subject: [PATCH] (bugfix) locale.ready() now resolves to data The documentation suggests that locale.ready(some_path) should return a promise that resolves with the data requested rather than the path. angular.module('myApp', ['ngLocalize']) .controller('exampleCtrl', ['$scope', 'locale', function ($scope, locale) { locale.ready('common').then(function (res) { // Before fix: // res --> 'common' // After fix: //res --> { "helloWorld" : "Hello World!", ... } }); } ]); --- src/localization.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/localization.js b/src/localization.js index e09c9c7..f422d0a 100644 --- a/src/localization.js +++ b/src/localization.js @@ -130,7 +130,7 @@ angular.module('ngLocalize') // If we issued a Promise for this file, resolve it now. if (deferrences[path]) { - deferrences[path].resolve(path); + deferrences[path].resolve(data); } }) .error(function (err) {