0
我想从角度带使用bs-typeahead指令。选择匹配时onselect不调用函数错误未捕获ReferenceError:myFunction未定义
*更新*
我希望当用户选择从选项的东西要执行的温控功能。但这种简单的情况下,不似乎是在这里工作和投掷的错误:
Uncaught ReferenceError: myFunction is not defined
这里是我的语法:
模板
<input type="text" class="form-control" ng-model="selectedState" bs-options="state for state in states" bs-on-select="myFunction()" placeholder="Enter state" bs-typeahead>
JS:
$scope.myFunction = function(){
console.log("This function is called.")
console.log($scope.selectedState);
}
任何人都可以如果我缺少任何东西,请在这里帮助我。
这里是我的plunker:http://plnkr.co/edit/Z89TQ027WzxQn6UDJfAL?p=preview