angular.js - angularjs $scope.$parent問題
大家讲道理
大家讲道理 2017-05-15 17:01:38
0
1
618

在一個cotroller中的scope如何在modal中的controller中使用,怎麼傳過去,研究了下$scope.$parent,還是沒明白怎麼弄

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

全部回覆(1)
phpcn_u1582

如果你用的UI Bootstrap的modal, 有個scope參數,直接把controller的$scope傳進去就行了:

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

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板