Calvin Durrant
Calvin Durrant

Reputation: 83

angularJS, " [$injector:modulerr]"

Why am i getting an injection error?

https://jsfiddle.net/pvaq1ywh/

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js"></script>
<div ng-app="myApp">
  <div ng-controller="Controller">
    {{greeting}}
  </div>
</div>

JS

var myApp = angular.module('myApp',["firebase"]);

myApp.controller('Controller', ['$scope', function($scope) {
  $scope.greeting = 'Hola!';
}]);

Upvotes: 0

Views: 26

Answers (1)

DerekMT12
DerekMT12

Reputation: 1349

On the JS pane, click settings, and set the load type to No wrap - in <body>.

It probably wasn't working because the script was executed before your dependencies were loaded.

Upvotes: 1

Related Questions