My markup was:
<input char-limit="10" />
Then I needed to set the attribute value from controller, so I did this:
<input char-limit="{{charLimit}}" />
And in controller:
$scope.charLimit = <my value>;
Now, instead of using the model value directly; I need to use the function to return the value. So I did:
<input char-limit="getCharLimit()" />
And in controller:
$scope.getCharLimit= function(){
return <my value>;
}
But the value is not reflected in the markup.
You need to enclose the function inside of curly braces
<input char-limit="{{getCharLimit()}}" />
Typically an Angular Expression must be enclosed within {{ }}
{{ expression }}
So the correct one should be : <input char-limit="{{getCharLimit()}}" />
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