首页 > 解决方案 > 在创建指令 angularjs 之前如何检查 html 绑定

问题描述

一个页面,我调用自定义选择框指令来显示月份,该指令需要一些参数:

<custom-select-box
     id="month"
     model="month"
     model-required
     model-name="month"
     options="month.value as month.name for month in months"
     aria-label="{{month.name}}">
     <option value="">{{'dcl-spa.components.claim-and-link.month.mm'|translate}}</option>
</custom-select-box>

但是当我直接到这个页面或刷新时,里面的参数{{'dcl-spa.components.claim-and-link.month.mm'|translate}}不能<option>绑定到 html,只是dcl-spa.components.claim-and-link.month.mm在页面上显示键。指令 custom-select-box 不能更改。那么我该怎么办呢?谢谢

标签: javascriptangularjscustom-directive

解决方案


选项标记应该在custom-select-box directive template.


推荐阅读