$ scope.abc()のデータを実際の関数に渡そうとしています。
[機能]
function sweetAlertCtrl($scope, SweetAlert, $state) {
$scope.demo1 = function() {
SweetAlert.swal({
title: "Good job!",
text: "You clicked the button!",
type: "success"
},
function ($state) {
$state.go('pjt.detailed', {id: $scope.id}) // This is where the data from $scope is received.
});
}
}
を[$スコープからのデータ]
$scope.demo1($scope.id);
は、どのように私は()関数をDEMO1する$ scope.idを渡すことができますか? $州を正しい場所に置くことさえできましたか?私はこれに新しいです、これは本当に混乱しています:)
私は何をすべきかアドバイスしてください。
ありがとうございます!あなたのcontroller
/service
/factory
の/ etc内の他の依存関係の中で
$scope.demo1 = function (id) {
SweetAlert.swal({
title: "Good job!",
text: "You clicked the button!",
type: "success"
},
function ($state) {
$state.go('pjt.detailed', {id: id})
});
}
ありがとうございます。はい、あなたは正しいです。私はその部分を欠いていた。行動を取るのは簡単でしたが、問題の内容を見つけるのは難しかったです。 :) どうもありがとうございます! –
答えとしてもう少し多くのコードを入力すると便利な場合があります。 – scipper