So I would like to know when one of my variable changes in the html side. But I couldn't find any way to use event listener ($watch) on my angular controller.
So, here is the problem that I am trying to fix:
<div class="form-group">
<label class="col-md-3 control-label">Please Select the Device</label>
<div class="col-md-9">
<select class="form-control" ng-model="reportCtrl.selectedDevice" ng-options="item.name as item.MyName for item in reportCtrl.deviceList">
</select>
</div>
</div>
<div class="form-group" ng-if="reportCtrl.selectedDevice">
<label class="col-md-3 control-label">Please Select the Sensor</label>
<div class="col-md-9">
<select class="form-control">
</select>
</div>
</div>
I fill the options with device list, depending on what user selects, I need to make another call to get all the sensor properties within that device, but I would like to make the call whenever user picks the device.
So how can I use event listener in this case to make my call??