Trying to create a simple angular app like this :
HTML
<div ng-app="myApp">
<div ng-controller="appCtrl">
Test Variable :
<input type="radio" class="radio-inline" name="test" ng-model="var.test" value=true> Yes
<input type="radio" class="radio-inline" name="test" ng-model="var.test" value=false> No
<hr>
<p>{{var.test}}</p>
<hr>
<p>Yes: <span ng-if="var.test">$</span></p>
<p>No: <span ng-if="!var.test">$</span></p>
</div>
</div>
Javascript
var myApp = angular.module('myApp', []);
myApp.controller('appCtrl', function($scope) {
$scope.var = {
test: true
}
})
But I get this error on page load :
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
Here is the fiddle.
Possibly it's a silly thing but I just can't figure out what is wrong with this code, please help me out. Thanks!