私のAPIから情報を取得するだけで、うまく応答します。私は私のビューにvm.thisDoctorにアクセスしていますが今
vm.getDoctor = function(id) {
$http.get(CONSTANTS.LINK+'/doctors/'+id).success(function(response) {
vm.thisDoctor = {
name : response.first_name + ' ' + response.last_name,
address : response.clinical_address,
};
console.log(vm.thisDoctor.address);
$state.go('tabs.doctor');
});
}
console.log(response)
意志出力、
Object {id: 1, username: "testmd", first_name: "Juan",
last_name: "Dela Cruz", type: "Pediatrician"…}
コントローラ医師は-this.htmlは、ここに私のapp.js
<a class="item item-thumbnail-left">
<img src="cover.jpg">
<h2>{{ appt.thisDoctor.name }}</h2>
<p>{{appt.thisDoctor.address}}</p>
</a>
.state('tabs.doctor', {
url: '/doctor/{doctorId}',
views: {
'tab-appts': {
templateUrl: 'templates/appts/doctors-this.html',
controller: 'ApptsCtrl as appt'
}
}
})
私のcode
は間違っていますか?私は今数時間これをやってきました。
場合 'vm.getDoctor'ですか?データなし引数で '、それは洞察力の先生 – charlietfl
の新しいインスタンスを作成します!!;あなたは' $のstate.go(「tabs.doctor」)を行うので、論理の流れは間違っていますどうもありがとうございます! 本当にお手伝いしました – markhamknight