Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从单击传递数据以加载模式_Javascript_Angularjs_Ionic Framework - Fatal编程技术网

Javascript 从单击传递数据以加载模式

Javascript 从单击传递数据以加载模式,javascript,angularjs,ionic-framework,Javascript,Angularjs,Ionic Framework,如何从调用中传递数据来加载一个模式,即这个var c,以便我可以在控制器上使用它来在查询中使用它 $scope.compareMe=函数(数据){ log($scope.cannedLst.name) var c=$scope.cannedLst.name; $scope.Data=c; $scope.modal.show(); }在使用您的控制器中,您可以将数据作为范围变量传递 //your main controller .controller('MyController', functi

如何从调用中传递数据来加载一个模式,即这个var c,以便我可以在控制器上使用它来在查询中使用它

$scope.compareMe=函数(数据){
log($scope.cannedLst.name)
var c=$scope.cannedLst.name;
$scope.Data=c;
$scope.modal.show();

}
在使用您的控制器中,您可以将数据作为范围变量传递

//your main controller
.controller('MyController', function($scope, $ionicModal) {

//you function to get data and call modal
  $scope.compareMe = function(Data) {
    console.log($scope.cannedLst.name)
    var c = $scope.cannedLst.name;
//this is the data we're passing
    $scope.Data = c;
    $scope.modal.show();
  }

//modal configuration (may be 'templateString')
  $ionicModal.fromTemplateUrl('my-modal.html', {
//here it states that inside the modal $scope will be == data you've passed
    scope: $scope.Data,
    animation: 'slide-in-up'
  }).then(function(modal) {
    $scope.modal = modal;
  });

你使用或你的意思是引导模式?ng模式不是引导模式长官@shershen$ionicModal我是说离子模式长官@shershen@shershen如何从其他控制器访问数据?