Can Angular tags be selected using JQuery? I am currently utilizing the ui-select Angular component, which is integrated into the HTML page as shown below:
<ui-select ng-model="rec.currencyCode" on-select="ctrl.selectCurrencyCode(rec, $item)">
<ui-select-match placeholder="{{ 'SelectCurrency' | resource:'GuiText' }}">
<span ng-bind="$select.selected"></span>
</ui-select-match>
<ui-select-choices repeat="item in ctrl.currencies">
<span ng-bind-html="item.codeA3"></span><br />
</ui-select-choices>
</ui-select>
However, attempts to select the tag with JQuery using these two selectors have proven unsuccessful:
$("ui-select").each(function () {
}
$("select").each(function () {
}
UPDATE: The JQuery code is executed from a TypeScript controller:
validate(): boolean {
var that = this;
this.errors = [];
var inputs = $("input[format='number']");
inputs.each(function () {
var str = $(this).val();
if (str != null && str.length > 0) {
var val = parseFloat(str);
if (isNaN(val)) {
that.addError($(this).parent().attr("val-property"), "Value is not a number");
}
}
});
var currencyCodes = $("ui-select");
currencyCodes.each(function () {
var str = $(this).val();
console.log(this);
console.log(str);
if (str == null) {
that.addError($(this).parent().attr("val-property"), "Currency not selected");
}
});
return this.errors.length == 0;
}