我在布线中遗漏了一些东西。单击该按钮时,方法中的警报不会显示。
<div id="mapFilter" ng-controller="MapsController">
<div>
<h3>{{SelectedCustomer.officeName}}</h3>
<input type="button" ng-click="getProperties()" value="Get Data" />
</div>
<div>
<p>hotel count: {{allHotels.length}}</p>
<p>preferred count: {{preferredHotels.length}}</p>
</div>
</div>
预期的执行点:
$scope.getProperties = function () {
var msg = 'Unable to load Properties: ';
alert("getProperties");
Plunkr:
http://plnkr.co/edit/4eF1Wu4tURysTji0b5kO?p=preview
谢谢!
答案 0 :(得分:1)