大佬教程收集整理的这篇文章主要介绍了angularjs – 通过id值到离子模态点击,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
但是在这个点击事件上,我需要传递一个id值,以便我可以把这个id的值显示出来,这是控制器的一部分,
$ionicModal.fromTemplateUrl('modal.html',function($ionicModal) { $scope.modal = $ionicModal; },{ // Use our scope for the scope of the modal to keep it simple scope: $scope,// The animation we want to use for the modal entrance animation: 'slide-in-up' });
有什么办法吗?
谢谢.
$ionicModal.fromTemplateUrl('modal.html',function($ionicModal) { $scope.modal = $ionicModal; },{ // Use our scope for the scope of the modal to keep it simple scope: $scope,// The animation we want to use for the modal entrance animation: 'slide-in-up' }); $scope.openModal = function(id) { $scope.selectedId = id; $scope.modal.show(); }
在你看来:
<ul> <li ng-repeat="item in items" ng-click="openModal(item.id)"> {{ item.name }} </li> </ul>
那么你可以访问你的模式中的id:
<div class="modal"> <h1>{{ selectedId }}</h1> </div>
以上是大佬教程为你收集整理的angularjs – 通过id值到离子模态点击全部内容,希望文章能够帮你解决angularjs – 通过id值到离子模态点击所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。