问题描述
我试图在打开时将一些模型数据传递到模态窗口中.当用户点击某个元素时,我希望打开模态窗口并显示与点击内容相关的更多详细信息.
I am trying to pass some model data into a modal window when it is opened. When the user clicks on an element I want to have the modal window open and display more detailed information relating to what was clicked on.
我创建了一个 plunker,它按照我想要的方式工作,除了传递数据进入模态窗口.
I have created a plunker that works how I want it to except for passing the data into the modal window.
我正在尝试使用 ng-click 传递数据:
I am trying to pass the data in using ng-click:
<img ng-src="{{item.picture}}" width="100" ng-click="open(item)"/>
谁能帮我解决这个问题?或者给我指明正确的方向?
Can anyone help me with this? or point me in the right direction?
推荐答案
这个怎么样?
我已将该项目添加到解析中
I added the item to the resolve
resolve: {
items: function () {
return $scope.items;
},
item: function(){
return size;
}
}
在 controller
中,我在做:$scope.item = item;
在注入 item
And in the controller
I am doing: $scope.item = item;
after injecting the item
这篇关于Angular-ui modal - 将数据传递到模态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!