在 dropDown 指令中插入一个小表单
Insert a small form into a dropDown directive
我需要帮助plunker
在我的工作中,我需要打开一个小下拉菜单,其中将包含一个小表格。必须是指令。
1- 我的指令将收到一个模型(我不知道为什么,它没有显示)
2- 模型必须打印在输入上
3- 使用保存按钮写入的新参数必须通过回调传递给参数
- 如果我点击下拉菜单或点击取消按钮,下拉菜单必须关闭。
任何人都可以帮助我完成这项工作吗?
非常感谢
<body class="container" ng-controller="mainCtrl" dropdown-listener>
<h1>option DropDown</h1>
original data: <h4>{{profile.city}},{{profile.province}},{{profile.country}}</h4>
<dropdown-multiselect user-profile="profile"></dropdown-multiselect>
</body>
我想我有一些与您正在寻找的东西接近的东西。
您首先需要将下拉菜单中的自动关闭设置为禁用,这样它就不会在您单击它时立即关闭。
<div class="btn-group" dropdown auto-close="disabled" is-open="isopen">
您在尝试直接 link 表单输入到外部变量时也遇到了问题。我想你只想在按下 "submit" 时设置那些?
无论如何...看看这个 plunker,看看它是否更接近您要找的东西。
http://plnkr.co/edit/rK3gmN9rHksZrGuEM6r6?p=preview
编辑 plunker 现在使用 ng-init 具有初始值。
<input type="text" id="ciudad" ng-init="profile.country=initProfile.country" ng-model="profile.country"></input>
我需要帮助plunker
在我的工作中,我需要打开一个小下拉菜单,其中将包含一个小表格。必须是指令。
1- 我的指令将收到一个模型(我不知道为什么,它没有显示)
2- 模型必须打印在输入上
3- 使用保存按钮写入的新参数必须通过回调传递给参数
- 如果我点击下拉菜单或点击取消按钮,下拉菜单必须关闭。
任何人都可以帮助我完成这项工作吗?
非常感谢
<body class="container" ng-controller="mainCtrl" dropdown-listener>
<h1>option DropDown</h1>
original data: <h4>{{profile.city}},{{profile.province}},{{profile.country}}</h4>
<dropdown-multiselect user-profile="profile"></dropdown-multiselect>
</body>
我想我有一些与您正在寻找的东西接近的东西。
您首先需要将下拉菜单中的自动关闭设置为禁用,这样它就不会在您单击它时立即关闭。
<div class="btn-group" dropdown auto-close="disabled" is-open="isopen">
您在尝试直接 link 表单输入到外部变量时也遇到了问题。我想你只想在按下 "submit" 时设置那些?
无论如何...看看这个 plunker,看看它是否更接近您要找的东西。
http://plnkr.co/edit/rK3gmN9rHksZrGuEM6r6?p=preview
编辑 plunker 现在使用 ng-init 具有初始值。
<input type="text" id="ciudad" ng-init="profile.country=initProfile.country" ng-model="profile.country"></input>