AngularJS Question:

How to initiate variable in AngularJS?

Tweet Share WhatsApp

Answer:

1 <div ng-app="" ng-init="quantity=10;cost=5">
2 <b>Total Cost: {{ quantity * cost }}</b>
3 </div>

Download AngularJS PDF Read All 57 AngularJS Questions
Previous QuestionNext Question
What is Data Binding in Angular JS?Does Angular use the jQuery library?