Javascript 从单击传递数据以加载模式
如何从调用中传递数据来加载一个模式,即这个var c,以便我可以在控制器上使用它来在查询中使用它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
$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如何从其他控制器访问数据?