In this example, ng-init directive initialize the value of quantity and price variable which are bind to quantity and price textbox respectively like: ng-init="quantity=10;price=2000" Below textboxes total is shown in bold element by multiplying quantity and price like {{quantity*price}}.

<!DOCTYPE html> <html xmlns=""> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src=""></script> </head> <body ng-app> <div> <div class="container" ng-init="quantity=10;price=2000"> Quantity: <input type="number" ng-model="quantity"><br /> Costs: <input type="number" ng-model="price"><br /> Total= <b>{{quantity*price}}</b> </div> </div> </body> </html>