i trying to display 3 variables in view but getting errors in the console
here the code of script.js
var myApp = angular
.module("myModule",[])
.controller("myController", function ($scope) {
var employee = {
firstName: "Sunil"
lastName: "Bhatraju"
gender: "Male"
};
$scope.employee = employee;
});
here is the code of demo.html
<!doctype html>
<html ng-app="myModule">
<head>
<script src="Scripts.js/script.js"></script>
<script src="Scripts.js/angular.js"></script>
</head>
<body>
<div ng-controller="myController">
<div>
First Nmae: {{ employee.firstName }}
</div>
<div>
Last Name : {{ employee.lastName }}
</div>
<div>
Gender : {{ employee.gender }}
</div>
</div>
the errors its displaying on the console are
1)Uncaught SyntaxError: Unexpected identifier
2)Uncaught Error: [$injector:modulerr] Failed to instantiate module myModule due to: Error: [$injector:nomod] Module 'myModule' 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.
angular.module("myModule",[])
defined at multiple places – Rakeschand