I'm currently working on an angularJS app that needs to have a translation functionality, So I've checked the Angular-translate library and did everything that's in the example.
However when I run my code I get the following error:
Error: Unknown provider: translateFilterProvider <- translateFilter
I've included my code in the following jsfiddle: /
I loaded the angular-translate javascript file before calling the code in the fiddle (which is in portal.js)
this is the order in which I load my files:
<script src="js/lib/angular.js"></script>
<script src="js/lib/angular-resource.js"></script>
<script src="js/lib/jquery-1.10.js"></script>
<script src="js/lib/angular-translate.js"></script>
<script src="js/portal.js"></script>
If anyone can help me out it's highly appreciated,
In case you wondered and since my fiddle is a bit messed up, I did bootstrap my app
<html lang="nl" ng-app="portal">
thx,
J.
I'm currently working on an angularJS app that needs to have a translation functionality, So I've checked the Angular-translate library and did everything that's in the example.
However when I run my code I get the following error:
Error: Unknown provider: translateFilterProvider <- translateFilter
I've included my code in the following jsfiddle: http://jsfiddle/qYqw8/1/
I loaded the angular-translate javascript file before calling the code in the fiddle (which is in portal.js)
this is the order in which I load my files:
<script src="js/lib/angular.js"></script>
<script src="js/lib/angular-resource.js"></script>
<script src="js/lib/jquery-1.10.js"></script>
<script src="js/lib/angular-translate.js"></script>
<script src="js/portal.js"></script>
If anyone can help me out it's highly appreciated,
In case you wondered and since my fiddle is a bit messed up, I did bootstrap my app
<html lang="nl" ng-app="portal">
thx,
J.
Share Improve this question edited Jun 17, 2018 at 14:01 Mosh Feu 29.4k18 gold badges93 silver badges141 bronze badges asked Jul 31, 2013 at 13:17 J.PipJ.Pip 4,6237 gold badges34 silver badges54 bronze badges 01 Answer
Reset to default 4Your fiddle is a bit messed up (for example you don't bootstrap the app and some other deps are missing). But in order to use angular-translate, you need to declare it a dependency in your controller:
app.controller("MyCtrl", function($scope, $translate) {
// do some stuff
});