在下文中,当我点击"搜索图标"时,控制台中会弹出以下内容
TypeError: Cannot read property 'scrollTo' of null
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:39909:17
at wrappedCallback (http://localhost:8100/lib/ionic/js/ionic.bundle.js:19197:81)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:19283:26
at Scope.$eval (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20326:28)
at Scope.$digest (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20138:31)
at Scope.$apply (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20430:24)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:21938:36
at completeOutstandingRequest (http://localhost:8100/lib/ionic/js/ionic.bundle.js:12022:10)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:12330:7
我在body
标记
<ion-header-bar class="logo-bar">
<button class="button button-clear">
<a ui-sref="root.home"><img class="pull-left" src="img/X.png"></a>
</button>
<h1 class="title">
<a ui-sref="root.search" class="icon ion-search" nav-clear></a>
</h1>
</ion-header-bar>
<ion-nav-view name="rootContent" class="main-body" animation="slide-left-right">
</ion-nav-view>
我的主页rootContent
内容如下:
<ion-side-menus>
<ion-side-menu-content>
<ion-nav-bar class="app-menu bar-stable" animation="nav-title-slide-ios7" title="">
</ion-nav-bar>
<ion-view name="mainContent">
<ion-content>
This tag breaks click on SEARCH. Remove ion-content and it will work OK
</ion-content>
</ion-view>
</ion-side-menu-content>
</ion-side-menus>
如果我要删除上面的ion-content
标记,则错误消失。我想知道它有什么问题以及如何解决它。
- 修改
点击搜索点击rootContent
中的下方,过渡到此处就是它突破的地方:
<ion-view>
<div class="list list-inset">
<label class="item item-input">
<i class="icon ion-search placeholder-icon"></i>
<input type="text" placeholder="Search" ng-model="searchTerm" ng-change="doSearch(searchTerm)">
</label>
</div>
</ion-view>
答案 0 :(得分:0)
这是Ionic beta 12中的一个错误。
它固定在高度构建(离子β13)