angular-localization
angular-localization copied to clipboard
(bugfix) locale.ready() now resolves with 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!", ... }
});
}
]);