加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何将自定义数据传递给角带模式

发布时间:2020-12-17 10:20:07 所属栏目:安全 来源:网络整理
导读:我正在使用angular-strap的模态,并建立了自己的模板.我的问题是我的模板有2个按钮,但是,我会更改这些按钮的文本和功能.因此,我想在打开它之前将该数据传递给模态. 在文档中说 // Pre-fetch an external template populated with a custom scope var myOtherM
我正在使用angular-strap的模态,并建立了自己的模板.我的问题是我的模板有2个按钮,但是,我会更改这些按钮的文本和功能.因此,我想在打开它之前将该数据传递给模态.

在文档中说

// Pre-fetch an external template populated with a custom scope
  var myOtherModal = $modal({scope: $scope,template: 'modal/docs/modal.tpl.demo.html'});

但是,我无法让它工作.请注意,我只想将一些值传递给模态范围,而不是我的整个父范围(这是示例似乎做的)

它不像ui-bootstrap那么简单,但它看起来更灵活:
// creates new isolated scope
var myNewScope = $scope.$new(true);
// then you can data to your new scope
myNewScope.users = ["User1","User2","User3"];
var myOtherModal = $modal({scope: myNewScope,template: 'modal/docs/modal.tpl.demo.html'});

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读