- ng-init
Add numbers ng-init
examples/angular/add_numbers_ng_init.html
<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>
<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>