Angular テンプレートに 3 つのリンクがあるページがあります。最初のリンクは機能しますが、次の 2 つのリンクは機能しません。最初のリンクはカーソルをポインターとして表示し、次の 2 つのリンクはカーソルを auto/default として表示します。リンクは次のとおりです。
<a ui-sref="doctorMain">Doctor Main</a><p/>
<a ui-sref="doctor.chat">Doctor Chat</a><p/>
<a ui-sref="user.chat">User Chat</a>
最初のリンクは機能し、他の 2 つのリンクはコンソールに次のメッセージを出力します。
Error: Could not resolve 'user.chat' from state 'userMain'
at Object.transitionTo (angular-ui-router.js:3074)
at Object.go (angular-ui-router.js:3007)
at angular-ui-router.js:4057
at angular.js:17918
at e (angular.js:5552)
at angular.js:5829(anonymous function) @ angular.js:12520(anonymous function) @ angular.js:9292(anonymous function) @ angular.js:17921e @ angular.js:5552(anonymous function) @ angular.js:5829
これは、私の app.config モジュールでルーティングを行った方法です。
$stateProvider
.state('doctorMain', {
url: "/doctorMain",
templateUrl: "partials/doctor/doctor-main.html",
controller: 'DoctorJoinChat',
data: {
doctor: true
}
})
.state('doctor.chat', {
url: "/doctorChat",
templateUrl: "/partials/test.html",
controller: 'DoctorJoinChat',
data: {
doctor: true
}
})
.state('userMain', {
url: "/userMain",
templateUrl: "/partials/patient/form.html",
data: {
user: true
}
})
.state('user.chat', {
url: "/userChat",
templateUrl: "/partials/test.html",
data: {
user: true
}
});