Answer the question
In order to leave comments, you need to log in
How to make friends AngularJS and custom inputs?
I just started to understand AngularJS, and I have no one to ask ...
I'm trying to use getting the value of a variable from the input (radio). This is easy to do - ng-model="realty". Until I put a custom view on this input... I use Jquery Form Styler. I get a wrapper like:
<div class="jq-radio">
<input type="radio" name="step-1" ng-model="realty" value="house">
<div class="jq-radio__div"></div>
</div>
Answer the question
In order to leave comments, you need to log in
You can try Angular Light, here is an example that only renders elements. And so if it is necessary to receive values.
Inherited standard al-radio jsfiddle with two-way binding for Jquery Form Styler.
function MyCustomInputDirective () {
return {
require: 'ngModel',
link: function (scope, el, attr, ngModelController) {
// ... а тут происходит магия
}
};
}
In order to work with any of these jQuery plugins, you need a directive that will take care of keeping the view and model in sync.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question