我本飞扬521 发表于 2016-4-20 09:57:46

Error: [ng:areq] Argument 'syController' is not a function, got undefined

路由的首页定义了controller,如下
.state('tab.sy', {
    url: '/sy',
    views:{
      'tab-sy':{
            templateUrl: "tabs/tab-sy.html",
            controller:'syController'
      }

    }

})
首页代码:<ion-view view-title="个人中心">
<ion-header-bar class="bar-assertive">
    <h1 class="title">个人中心</h1>
</ion-header-bar>


<ion-content>
      <a href="#/ztyxDet">Tab1</a>
      {{title}}
</ion-content>
</ion-view>
在首页点击进入子页面,子页面中也定义了一个controller;运行就报错Error: Argument 'syController' is not a function, got undefined

子页面代码:
<div ng-controller="ztyxDetailController" class="ztyxDetail">
      <div class="bar bar-header bar-assertive">
          <div class="button icon ion-ios-arrow-left"></div>
            <h1 class="title">主题游戏</h1>
          <div class="button icon ion-share" ng-click="show();"></div>
      </div>

      <div class="scroll-content has-header">
      <ul class="list list-detail">
          <li class="item item-thumbnail-left item-ztyx-detail">
            <img src="sy/imgs/yy.jpg" class="image">
            <div class="game">秦时明月</div>
            <div class="abstract">指点江山定四海沉浮苍生与你指尖苍生与你指尖</div>
            <div class="time">2016/01/10-2016/04/08</div>
            <a class="button button-assertive buttonSelf">开始游戏</a>
          </li>
      </ul>

      <div class="picture_sholder">
          <ion-scroll direction="x">
            <img ng-src="{{picture.face}}" ng-repeat="picture in pictures" class="images"></img>
          </ion-scroll>
      </div>

      <div style="padding:0 5px;">
          <h5>主题游戏介绍</h5>
          <p>2015年上映的一部由北京天河盛宴国际文化传媒有限公司、开得盛世(北京)投资管理公司、
          和云算(北京)网络科技有限公司联合投资拍摄。</p>
      </div>

      <div style="padding:0 5px;">
          <h5>参与细则说明</h5>
          <p>2015年上映的一部由北京天河盛宴国际文化传媒有限公司、开得盛世(北京)投资管理公司、
            和云算(北京)网络科技有限公司联合投资拍摄。</p>
      </div>

      <div style="padding:0 5px;">
          <h5>游戏奖励</h5>
          <p>一等奖:秦时明月抱枕(20名)<br>
             一等奖:秦时明月抱枕(20名)<br>
             一等奖:秦时明月抱枕(20名)</p>
      </div>
      </div>
    </div>
页: [1]
查看完整版本: Error: [ng:areq] Argument 'syController' is not a function, got undefined