0

How to add more than one function in ng-change?

Sample code:

<div class="col-md-2">
    <select id="sel2" ng-model="updateUser.user.state" name="state"
        ng-change="change(); updateUser.user.city=''"
        data-role="listview" required>
    <option value="">Select State</option>
    </select>
</div>
CoderPi
  • 12,985
  • 4
  • 34
  • 62
Prabu
  • 1
  • 1
  • 3

2 Answers2

1

You can just do the following

<div class="col-md-2">
<select id="sel2" ng-model="updateUser.user.state" name="state"
    ng-change="change1(); change2(); updateUser.user.city=''"
    data-role="listview" required>
<option value="">Select State</option>
</select>

Patrick Kelleter
  • 2,631
  • 1
  • 13
  • 19
0

You need to create a delegate function. Look through this post and it should get you started.

ng-change on select option calling multiple unique functions

Community
  • 1
  • 1
Harbinger
  • 594
  • 1
  • 8
  • 18