【问题标题】:passing parameter in ionic在离子中传递参数
【发布时间】:2016-10-11 15:39:37
【问题描述】:

i 托盘使用离子第一视图制作数字生成器包含输入类型数字

<ion-view view-title="Home View"> 
<ion-content class="padding">
<label class="item item-input">
<span class="input-label">number</span>
 <input type="number" ng-model="num">
</label>

      <button ui-sref="page2" class="button button-block button-positive" >
      View List
    </button>
    </ion-content>
     </ion-view>

第二页列出从0到用户输入的数字

<ion-view view-title="list view">
<ion-content class="padding">

<h1>{{number}}</h1>

<button ui-sref="page1" class="button button-block button-positive" >
      GO TO HOME
 </button>
 </ion-content>
 </ion-view>

这是controllers.js

.controller('page1', function($scope, $rootScope) {

 $rootScope.num="";

  })

  .controller('page2', function($scope, $rootScope, $stateParams) {

   var number= $stateParams.page2;

    $scope.n=number;



    });

如何将第 1 页中的数字传递到第 2 页并从该数字的第 0 个开始列出

【问题讨论】:

    标签: angularjs ionic-framework


    【解决方案1】:

    我回答了here 一个像你这样关于通过页面传递参数的问题。

    检查一下!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-23
      • 2022-10-12
      • 1970-01-01
      • 1970-01-01
      • 2019-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多