2 Answers
It can be done easily as shown below:
<div ng-init="data = 'This is initialized in ng-init'">
Variable - {{data}}
</div>
Refer the demo here
It can be done easily as shown below:
<div ng-init="data = 'This is initialized in ng-init'">
Variable - {{data}}
</div>
Refer the demo here