Open darshakmehta opened 8 years ago
Hi, me to I got the same problem it seems that it doesn't work fine ! do we miss something ?
@tech-boy You need to initialize angular app and controller like this
<!doctype html>
<html lang="en" data-ng-app='myapp' >
<head>
<meta charset="utf-8">
<title>AngulasJS Demo3</title>
<script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<script>
angular.module('myapp',[])
.controller('nameController',nameController);
function nameController($scope){
$scope.firstname = 'John';
$scope.lastname = 'Smith';
}
</script>
</head>
<body data-ng-controller = "nameController">
First Name : <input type = "text" data-ng-model="firstname"></input>
<br />
<br />
Last Name : <input type = "text" data-ng-model="lastname"></input>
<br />
<br />
Hello {{ firstname }} {{lastname}}
</body>
</html>
What is going wrong here ?