angular-localization icon indicating copy to clipboard operation
angular-localization copied to clipboard

(bugfix) locale.ready() now resolves with data

Open PiusNyakoojo opened this issue 9 years ago • 0 comments

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!", ... }
            });
        }
    ]);

This change is Reviewable

PiusNyakoojo avatar Oct 08 '16 02:10 PiusNyakoojo