Reputation:
I have written the following program to print Hello, Angular!
but it does not work. Please guide.
<!DOCTYPE html>
<html ng-app="gemStore" ng-init="person={text:'Hello, Angular!'>
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
<h1><div>
{{person.text}}
</div></h1>
</body>
</html>
Upvotes: 1
Views: 61
Reputation: 11
You forgot the right bracet and the quote. See the example below.
Upvotes: 0
Reputation: 1182
You have typo mistake, replace your code with below.
<!DOCTYPE html>
<html ng-app="gemStore" ng-init="person={text:'Hello, Angular!'}>
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
<h1><div>
{{person.text}}
</div></h1>
</body>
</html>
Upvotes: 0
Reputation: 28289
Replace :
ng-init="person={text:'Hello, Angular!'>
with:
ng-init="person={text:'Hello, Angular!'}">
Upvotes: 1
Reputation: 3681
You need a closing brace and quote for the ng-init
ng-init="person={text:'Hello, Angular!'}"
Upvotes: 1