seema choudhary seema choudhary - 7 months ago 4
HTML Question

Why this angularjs code is not working?

This is my html code, and it's not giving the proper output. Ιt's not working by using

{{expression}}
, that's why I use
ng-bind
. Βut still not working, although I use both the way to print the enter value. What is the mistake in this code?

Τhis is the output it's showing:


firstname:

lastname:

fullname:
{{firstname}}





<!doctype html>
<html ng app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
</head>
<body >
<div>
<label>first name:</label><input type="text" ng-model="firstname"/>
<hr>
<label> last name:<input type="text" ng-model="lastname"/><br><br></label>
<h3>full name <span ng-bind="firstname"> </span> {{firstname}} </h3>


</div>
</body>
</html>



Answer

Just convert this

<html ng app>

to this

<html ng-app>
Comments