I am trying to display 3 variables, but getting errors in the console
here is the script.js code
var myApp = angular
.module("myModule",[])
.controller("myController", function ($scope) {
var employee = {
firstName: "Sunil"
lastName: "Bhatraju"
gender: "Male"
};
$scope.employee = employee;
});
here is the demo.html code
<!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>
errors displayed on the console
1) Uncaught SyntaxError: Unexpected identifier
2) Missed error: [$ injector: modulerr] Failed to create myModule module because of: Error: [$ injector: nomod] Module 'myModule' is not available! You either mistakenly wrote the name of the module, or forgot to load it. If registering a module ensures that you specify the dependencies as the second argument.

source
share