0
$ stateProviderでAngularJSを使用していて、2つの異なる州が同じテンプレートを指しています。コードスニペットは、問題がコントロールがmytraining状態に流れないということである角度UIルーター異なる州の同じTemplateUrl問題
$stateProvider
.state('training', {
url: "/training",
templateUrl: "partials/training.html",
controller: function($scope, $http, $state, $uibModal){
console.log("Main Training State");
$http.get('/api/training').success(function (response){
var data = response;
$scope.courses=data.courses;
}).error(function(err,status){
console.log(err);
});
$scope.openReadMoreModal = function (course) {
var modalInstance = $uibModal.open({
animation: true,
templateUrl: 'readmoremodal.html',
controller: 'ModalInstanceCtrl',
resolve: {
modalObject: course
}
});
};
}
})
.state('mytraining', {
url: "training/me",
templateUrl: "partials/training.html",
controller: function($scope, $http, $state, $uibModal){
console.log("get My Events in the training html");
$http.get('/api/training/myevents').success(function (response){
console.log("response :"+ response);
$scope.courses = response.courses;
}).error(function(err,status){
console.log(err);
});
$scope.openReadMoreModal = function (course) {
var modalInstance = $uibModal.open({
animation: true,
templateUrl: 'readmoremodal.html',
controller: 'ModalInstanceCtrl',
resolve: {
modalObject: course
}
});
};
}
})
を下回っています。問題は何ですか?
を:URL: "/トレーニング/私 "、mytraining状態のため –
@ RahulAroraありがとう..あなたは私の日を救った。それは働く.. –
私は答えとしてそれを書くでしょう。あなたがそれを受け入れることができれば。 –