AngularJS-Creating multiple buttons using ng-repeat each of with different names and functionalities -
i want create number of buttons using ng-repeat each when clicked should go different html pages. in below code tried using ng-init initializing array without controller. there other way using ng-repeat. please me in this.
<div ng-app="" ng-init="arr1=[{name:'hyderabad'},{name:'chennai'},{name:'pune'}]"> <input type="button" value="{{x.name}}" ng-repeat="x in arr1"/> </div>
try code snippit.
<div ng-app="" ng-init="arr1=[{name:'hyderabad'},{name:'chennai'},{name:'pune'}]"> <div ng-repeat="x in arr1"> <a ng-href="{{url want here based on logic}}"> <input type="button" value="{{x.name}}" /> </a> </div> </div> i dont know logic use url want redirected each button. ever is, add logic ng-href section
Comments
Post a Comment