插入一个小的形式进入一个下拉指令 [英] Insert a small form into a dropDown directive

查看:143
本文介绍了插入一个小的形式进入一个下拉指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助这个 plunker

在我的工作,我需要开一个小下拉菜单中,将包含一个小的形式。它必须是一个指令。

1 - 我的指令,将获得一个模型(东西,我不知道为什么,它doent秀)

-2-模型必须输入要打印

3的保存按钮,新的paremeter writen必须由一个回调传递给括号

<醇开始=4>
  • 如果我点击了下拉菜单,或者如果我点击取消按钮,下拉必须关闭。

  • 任何机构可以帮我做这份工作吗?

    由于真的

     &LT;体类=容器NG-控制器=mainCtrl下拉列表中,听者GT;  &LT; H1&GT;选项下拉&LT; / H1&GT;  原始数据:或其可H4&GT; {{profile.city}},{{profile.province}},{{profile.country}}&下; / H4&GT;  &LT;下拉列表,多选用户配置文件=配置文件&GT;&LT; /下拉,多选&GT;&LT; /身体GT;


    解决方案

    我觉得我有东西是接近你所寻找的。什么

    您需要的第一件事是自动关闭设置为禁用你的下拉所以当你点击它不会立即关闭。

     &LT; D​​IV CLASS =BTN-组下拉列表中自动关闭=禁用是开=ISOPEN&GT;

    您也有过,你试图将表单输入直接链接到外部变量的问题。我presume您只需要设置这些时,提交是pressed?

    反正...看看这个plunker,看看它是否是更接近你在找什么。

    http://plnkr.co/edit/rK3gmN9rHksZrGuEM6r6?p=$p$ PVIEW

    编辑的plunker使用NG-INIT现在有初始值。

     &LT;输入类型=文本ID =城NG-的init =profile.country = initProfile.countryNG模型=profile.country&GT;&LT ; /输入&GT;

    I need help with this plunker

    On my job i need open a small dropdown, that will contain a small form. It must be a directive.

    1- My directive will receive a model (something that i don't know why, it doent's show)

    2- the model must be printed on the input

    3- with the save button the new paremeter writen must pass by a callback to the paren

    1. if i click out the dropdown or if i click cancel button, the dropdown must close.

    can any body help me with this job?

    Really thanks

    <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>
    

    解决方案

    I think I have something that is close to what you are looking for.

    The first thing you need is the auto-close set to disabled on your dropdown so it doesn't close as soon as you click on it.

    <div class="btn-group" dropdown auto-close="disabled" is-open="isopen">
    

    You also had a problem where you were trying to directly link the form inputs to the outer variables. I presume you only want to set those when "submit" is pressed?

    Anyways... have a look at this plunker and see if it's closer to what you're looking for.

    http://plnkr.co/edit/rK3gmN9rHksZrGuEM6r6?p=preview

    Edited the plunker to now have initial values using ng-init.

    <input type="text" id="ciudad" ng-init="profile.country=initProfile.country" ng-model="profile.country"></input>
    

    这篇关于插入一个小的形式进入一个下拉指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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