Use angularjs variable inside html tag


Use angularjs variable inside html tag : You can use the angularjs variable inside the html tags. Here is simple example in which we have used angularjs variable to assign the dynamic id of the div element. Below is detailed example.


Assign angularjs variable inside html tag

You can use the angularjs variable inside the html tag as below –

Angularjs variable inside html tag

<div ng-repeat="data in result" id="{{$index + 1}}">
		 Counter :: {{$index + 1}}
                 Data :: {{data}}
	   </div>

Here you can also add your own condition on the basis of counter.


Advertisements

Add Comment

📖 Read More