I`m trying to get a json through Restangular but I have a error of
$injector.
this is my code:
var app = angular.module('ejemplosApp', ['restangular', 'ngRoute'])
.config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&callback=JSON_CALLBACK&appid=9f50a805aa0089a1edd1829a5db029f0');
});
app.controller('MainCtrl', function($scope, Restangular) {
$scope.clima = Restangular.all('clima').getList().$object;});
Error:
angular.js:38 Uncaught Error: [$injector:modulerr]
http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=ejemplosApp&p1=Erro…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A21%3A19)
Html Page :
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<script type="text/javascript"
src="https://code.angularjs.org/1.5.5/angular-route.min.js"></script>
<script
src="http://cdnjs.cloudflare.com/ajax/libs/restangular/1.3.1/restangular.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<div class="container" ng-controller="MainCtrl">
<h1>Clima</h1>
<h4>Manejo de recursos online</h4>
<hr>
lat y long: {{ clima.coord.lat }} , {{ clima.coord.lon }}
<br><br>
{{ clima | json }}
</div>
Any help ?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.