Home »
MCQs »
AngularJS MCQs
Consider the below statement, how to print the value of 'StudentName'?
21. Consider the below statement, how to print the value of "StudentName"?
<div ng-app="" ng-init="firstName='John'">
<p>Input something in the input box:</p>
<p>Name: <input type="text" ng-model="StudentName"></p>
<p>You wrote: _______</p>
</div>
- StudentName
- {{ StudentName }}
- { StudentName }
- { _StudentName }
Answer: B) {{ StudentName }}
Explanation:
The code is:
<div ng-app="" ng-init="firstName='John'">
<p>Input something in the input box:</p>
<p>Name: <input type="text" ng-model="StudentName"></p>
<p>You wrote: {{ StudentName }}</p>
</div>