Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have the following html form select statement

<select ng-change="setBillGroup()" ng-model="bill.groupId" class="span8" ng-options="d.id as d.name for d in groups"></select>

and the js

myApp.controller('myAppController', function($scope, myAppService) {

.....
function setBillGroup(){
 console.log("setBillGroup method called!");
    ......
 }

....
});

But for some reason the setBillGroup() never seems to get called when I select something or the other in the form.

share|improve this question

1 Answer

up vote 2 down vote accepted

You have to define the method in the scope.

$scope.setBillGroup = function(){
 console.log("setBillGroup method called!");
    ......
 }
share|improve this answer
Wow! Never felt this dumb! Thank you! – user1324816 yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.