ui-sref无法处理ionicview,但适用于浏览器,设备和模拟器

时间:2016-11-28 13:41:41

标签: javascript angularjs ionic-framework ionic-view

我使用ionic来开发应用程序。有很多链接,他们都工作正常。仅在特定列表中,链接不能仅在ionicview中工作。 html是:

    <ion-list class="indexed-list">
        <ion-item
            class="item item-avatar"
            ng-repeat="item in categoriesEntity"
            ui-sref="app.entityListSubCategory({subCategoryId: item.id})"
        >
            <img src="img/ionic.png">
            <h2 ng-bind="item.name"></h2>
            <span
                class="header assertive"
                ng-if="item.name.substr(0, 1) !== categoriesEntity[$index - 1].name.substr(0, 1)"
                ng-bind="item.name.substr(0, 1)"
            ></span>
        </ion-list>
    </ion-list>

我在浏览器,模拟器和设备上工作正常。我尝试将ui-sref替换为ng-click="alert('hello')",但它确实有效。我还尝试将ui-sref移动/复制到imgh2标签,但它们也不起作用。我还尝试将ui-sref替换为ng-click并使用$state服务来更改路由,但它也无效。

我将JS错误记录到服务器。点击ion-item时没有出现JS错误。

2 个答案:

答案 0 :(得分:1)

这是因为我在ui-router中的模板名称之前写了一个斜杠: - (

答案 1 :(得分:0)

您可能尚未关闭func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if(indexPath.row == 0 ){ return 260 } return 85 } <ion-item>已关闭两次?

相关问题