功能没有显示点击按钮

时间:2016-06-05 20:02:49

标签: javascript angularjs function ionic-framework

Hy人,

您能帮我解决http://play.ionic.io/app/44e0a65d2252

中的代码问题

我有一个按钮thar当我点击它时调用一个带有2个参数的函数 应该显示带有一些数据的<p>标记。

JS:

this.showTime = function(stopcode, linha){
      //alert("Selected Value: " + stopcode +" "+ linha);
      $http.get("http://188.251.238.127/?code="+ stopcode+"&lcode="+linha)
            .success(function (datastop){
                  self.smsbus = datastop.linhas;
                  DataStore.smsbus = self.smsbus;
            })
            .error(function(error){
                DataStore.smsbus.length = 0;
                alert("Endereço inválido.")
            });
    };

HTML:

<button class="button button-block button-energized" ng-click="homeCtl.showTime(stopcode, linha)">Procurar</button>

      <div>
        <p ng-repeat="smsbuss in homeCtl.smsbus">{{smsbuss.eta}}<p>
      </div>

0 个答案:

没有答案