私はすべての例を見て、私のIonicプロジェクトと統合しようとしましたが失敗しました。ここまで私がこれまで持っていたことがあります。Ionicアプリケーションのページ間でデータを渡す方法
私は、コントローラとルートのために、私は
(agentSchedule.html)
<ion-view style="" title="Agent Schedule">
<ion-content class="has-header" overflow-scroll="true" padding="true">
<ion-refresher on-refresh="doRefresh()">
</ion-refresher>
<div ng-controller="agentScheduleCtrl">
<ion-list style="">
<ion-item class="item-icon-right item item-text-wrap item-thumbnail-left" ng-repeat="user in users">
<img ng-src="{{ user.image }}">
<h2>{{ user.fname }} {{ user.lname }}</h2>
<h4>Role : {{ user.jobtitle }}</h4>
<h4>Username : {{ user.username }}</h4><i class="button-icon icon ion-ios-arrow-forward"></i>
</ion-item>
</ion-list>
</div>
</ion-content>
ここ
にJSONファイルをロードするイムhtmlページを持っているcreator.ionic.com
を使用して作成したプロジェクトをされて使用していますそのページ
.controller('agentScheduleCtrl', function($scope, $http, $timeout) {
var url = "http://www.otago.ac.nz/itssd-schedule/mobileappdevice/services/getUsers.php";
var url = "users.json";
$http.get(url).success(function(response) {
$scope.users = response;
});
.state('menu.agentSchedule', {
url: '/page4',
views: {
'side-menu21': {
templateUrl: 'templates/agentSchedule.html',
controller: 'agentScheduleCtrl'
}
}
})
私は使用したい別のページですRNAMEは、その後、どのように次のページにuser.username JSON変数を渡すためにここでは、そのページ
.controller('specificAgentDetailsCtrl', function($scope) {
})
.state('menu.specificAgentDetailsCtrl', {
url: '/page9',
views: {
'side-menu21': {
templateUrl: 'templates/specificAgentDetailsCtrl.html',
controller: 'specificAgentDetailsCtrl'
}
}
})
ためのコントローラとルートがある私は
(specificAgentDetails.html)
<ion-view style="" view-title="Agent Specific Schedule">
<ion-content class="has-header" overflow-scroll="true" padding="true">
</ion-content>
</ion-view>
そこから行くの任意のページで使用しますグローバル変数として?
すべてのヘルプは素晴らしいだろう - 真のほとんどのイオン性のアプリケーションはSPAのように設定されている円
AngularはSPAフレームワークです。あなたは1(!!!).htmlページを持っていて、その中にいくつかの.htmlページではなく、ビューを切り替えるはずです。 – shershen
Ionicの新機能は、creator.ionic.comで作成した方法です。使用しているフォーマットを使用したアイデアはどれですか? –