angular.js - angularjs $scope.$parent问题

查看:294
本文介绍了angular.js - angularjs $scope.$parent问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

在一个cotroller中的scope如何在modal中的controller中使用,怎么传过去,研究了下$scope.$parent,还是没明白怎么弄

解决方案

如果你用的UI Bootstrap的modal, 有个scope参数,直接把controller的$scope传进去就行了:

scope (Type: $scope) - The parent scope instance to be used for the
modal's content. Defaults to $rootScope.

这篇关于angular.js - angularjs $scope.$parent问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆