0

所以我将 IONIC 与 AngularJS 一起使用,我的 .states 有问题:

app.config(function($stateProvider, $urlRouterProvider) {

    $stateProvider.state('app', {
    url : '',
    templateUrl: 'main.html',
    abstract: true,    
  })
    $stateProvider.state('app.recherche', {
    url: '/recherche',
    views: {
      vRecherche: {
        templateUrl: 'recherche.html',
        controller: 'MyCtrl'
      }
    },       
  })
    $stateProvider.state('app.recherche.index', {
    abstract: true, 
    url: '/',
    template : '<ion-nav-view></ion-nav-view>',      
  })
    $stateProvider.state('app.recherche.magasin', {
    url: '/magasin', //:dataId,
    controller: 'dataCtrl',    
    templateUrl: "magasin.html",
  })
    $stateProvider.state('app.reunion', {
    url: '/reunion',
    views: {
      vReunion: {
        templateUrl: 'reunion.html',
        controller: 'MyCtrl'
      }
    },

  })
    $urlRouterProvider.otherwise('/recherche');
})

而且我无法让我的页面重新加载,我只是更改了我的 URL……这就像不交换视图……

我有点迷路了

编辑 :

    <!---------------------------------------------------------------------------------------->      
    <!--------------------------------------- HOME ------------------------------------------->
    <!---------------------------------------------------------------------------------------->       
    <script type="text/ng-template" id="main.html">
         <ion-nav-bar class="bar-positive nav-title-slide-ios7" align-title="center">
            <ion-nav-back-button class="button-icon ion-arrow-left-c"></ion-nav-back-button>
          </ion-nav-bar>

          <ion-tabs class="tabs-positive">
            <ion-tab icon="icon ion-search" ui-sref="app.recherche">
              <ion-nav-view name="vRecherche"></ion-nav-view>
            </ion-tab>
            <ion-tab icon="icon ion-person-stalker" ui-sref="app.reunion">
              <ion-nav-view name="vReunion"></ion-nav-view>
            </ion-tab>
          </ion-tabs>
    </script>
<!---------------------------------------------------------------------------------------->      
<!------------------------------------- RECHERCHE ---------------------------------------->
<!---------------------------------------------------------------------------------------->      
    <script id="recherche.html" type="text/ng-template">
        <ion-view title="Recherche" hide-back-button="true">
            <ion-content class="padding">
                <div class="item item-divider" > 
                    Département :
                </div>
                <div class="item item-input-inset">
                    <label class="item-input-wrapper">
                        <i class="icon ion-search placeholder-icon"></i>
                        <input ng-model="search" type="text" placeholder="Recherche">
                    </label>
                    <button class="button button-small" ng-click="look(search)">
                        Submit
                    </button>
                </div>  
                <button class="btn btn-danger navbar-btn" ui-sref="app.recherche.magasin" >Button Submit</button>      
            </ion-content>
        </ion-view>
    </script>  
<!---------------------------------------------------------------------------------------->      
<!-------------------------------------- MAGASINS ---------------------------------------->
<!---------------------------------------------------------------------------------------->  
    <script id="magasin.html" type="text/ng-template">
        <ion-view title="Recherche : {{data.name}}">
            <ion-content class="padding">
                <div class="row">
                    <div class="col">
                        <div id="map"></div>
                    </div>
                    <div class="col">
                        ID : {{data.id}}<br/>
                        NOM : {{data.name}}
                    </div>
                </div>
            </ion-content>
        </ion-view>
    </script>
<!---------------------------------------------------------------------------------------->      
<!------------------------------------ REUNION --------------------------------------->
<!----------------------------------------------------------------------------------------> 
     <script id="reunion.html" type="text/ng-template">
        <ion-view title="Réunions">

         </ion-view>
      </script>

我正在通过以下方式寻找信息:http: //codepen.io/lizz/pen/bNKNey

我尝试了一些对我没有帮助的事情

我想要始终显示 2 个标签的应用程序。app.recherche 和 app.reunion

我想要 app.recherche 一个可点击的列表(这里只有一个按钮),让我进入一个滑动页面以获取信息 app.recherche.magasin

4

0 回答 0