查看/状态与IONIC

时间:2016-05-09 11:44:13

标签: javascript angularjs ionic-framework state ui-sref

所以我在AngularJS上使用IONIC,而且我的.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');
})

我无法重新加载我的网页,我只更改了网址...它就像没有交换视图...

我有点失落

编辑:

    <!---------------------------------------------------------------------------------------->      
    <!--------------------------------------- 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

0 个答案:

没有答案