I'm currently working on the following code :
<angucomplete-alt id="skill1"
selected-object="addSkill1()"
remote-url="@Url.Action("GetSkills", "ManageMission")/?query="
title-field="Name"
minlength="1"
match-class="angucomplete-match"
input-class="form-control"
template-url="@Url.Content("~/Templates/angucomplete-alt.html")"></angucomplete-alt>
$scope.addSkill1 = function () {
console.log(arguments);
};
By using a callback function, I'm trying to get the selected object value (as explained in angucomplete-alt documentation), but I receive the follwing error :
Error: [$compile:nonassign] Expression 'addSkill1()' used with directive 'angucompleteAlt' is non-assignable!
I digged the example from: Angucomplete Alt and I find out that you must provide the selected-object
like this, even if It's a callback function:
<angucomplete-alt id="skill1"
selected-object="addSkill"
remote-url="@Url.Action("GetSkills", "ManageMission")/?query="
title-field="Name"
minlength="1"
match-class="angucomplete-match"
input-class="form-control"
template-url="@Url.Content("~/Templates/angucomplete-alt.html")"></angucomplete-alt>
And the callback method should receive the selected
item as parameter:
$scope.addSkill = function (selected) {
console.log(selected);
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With