Home  >  Q&A  >  body text

angular.js - angularjs有没有 字典 模板?就是那些下拉选择,写成一个指令,弄一个字典,然后以后select标签用这个指令?

angularjs有没有 字典 模板?就是那些下拉框,写成一个指令,弄一个字典,然后以后select标签用这个指令代替,也不用在js中写select的options数据了?

懂得分享一下。分享一个这个功能的代码框架!!

需求:有一个文件专门存放字典数据,然后,指令的属性能够读取这个文件的其中一个数据,然后就能以下拉框读出来.....

类似这种代码模式:
<dict:select defaultValue="true" name="GJ" id="GJ" dictName="GJ" cssClass="form-control"/>

目的:集中管理,代码复用。

有人会吗?有人会吗?

大家讲道理大家讲道理2687 days ago458

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 17:04:28

    It is recommended that you learn directive. When you know how to write it, you can write how you want, and your ability has improved. Otherwise, you should ask for help next time if you have other needs. https://docs.angularjs.org/guide/directive

    reply
    0
  • Cancelreply