私はあなたが私を助けることを願っています。AngularJSビューで複数のng-disabledパラメータが機能しない - &&(および)および|| (または)
私はそれが簡単な解決策でなければならないと思いますし、複数の方法(括弧内のオプションなど)を試しましたが、うまく動作しない両方のパラメータを取得します。
私は単一のパラメータを使用するとうまく動作します。
これは私が達成しようとしているものです: 私の最初のドロップダウンフィールドの選択はどちらかである週または月、ダウン提出横のドロップを有効にする必要があります。
私が言及したように;単一のパラメータで動作します。例:
ng-disabled="reportSettingsData.ReportFrequencyName.ReportFrequencyType != Enum.ReportFrequency.Monthly"
しかし、|| (または)のミックスで、それがすべてで動作していない。ここで
ng-disabled="reportSettingsData.ReportFrequencyName.ReportFrequencyType != Enum.ReportFrequency.Monthly || reportSettingsData.ReportFrequencyName.ReportFrequencyType != Enum.ReportFrequency.Weekly"
は私のビューのフィールドダウン私の2ドロップです:
<!-- Frequency -->
<div class="col-md-3">
<label>Frequency</label>
<div class="input-dropdown">
<cc-dropdown cc-placeholder="Report Frequency"
ng-model="reportSettingsData.ReportFrequencyName"
ng-options="reportSettingsData.SelectableReportFrequencyNames"
ng-change="frequencyChanged()"
cc-fields="ReportFrequencyName"
cc-key-field="ReportFrequencyId"
cc-allow-search="reportSettingsData.SelectableReportFrequencyNames != null && reportSettingsData.SelectableReportFrequencyNames.length > 5"
name="iFrequencyName">
</cc-dropdown>
</div>
</div>
<div class="col-md-3">
<label>Frequency Options</label>
<div class="input-dropdown">
<cc-dropdown cc-placeholder="Report Frequency Option"
ng-model="reportSettingsData.ReportFrequencySelectionName"
ng-options="reportSettingsData.SelectableReportFrequencySelectionNames"
ng-disabled="reportSettingsData.ReportFrequencyName.ReportFrequencyType != Enum.ReportFrequency.Monthly || reportSettingsData.ReportFrequencyName.ReportFrequencyType != Enum.ReportFrequency.Weekly"
cc-fields="ReportFrequencySelectionName"
cc-key-field="ReportFrequencySelectionId"
cc-allow-search="true"
name="iFrequencySelections">
</cc-dropdown>
</div>
</div>
は、事前にありがとうございます!
なぜダウン投票?私は研究を行い、複数の方法を試みました。 – onmyway