Add numbers ng-init
- ng-init
<script src="angular.min.js"></script>
<div ng-app ng-init="a = 19; b = 23;">
<input ng-model="a" type="number">
<input ng-model="b" type="number">
<h1>{{ a + b }}</h1>
</div>
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
<script src="angular.min.js"></script>
<div ng-app ng-init="a = 19; b = 23;">
<input ng-model="a" type="number">
<input ng-model="b" type="number">
<h1>{{ a + b }}</h1>
</div>