I have a simple directive that wraps the iCheck library method call for input elements:
export class iCheck implements ng.IDirective
{
restrict: string;
replace: boolean;
transclude: boolean;
constructor()
{
this.transclude = false;
this.replace = true;
this.restrict = "A";
}
link(scope: any, element: JQuery, attributes: ng.IAttributes)
{
var Checkbox: any = element;
Checkbox.addClass("i-checks");
Checkbox.iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
});
}
}
This directive does not have any template associated with it. In the view I simply add this directive as an attribute to an input:
<input icheck type="radio" name="Test" ng-value="1" ng-model="Controller.Test" />
This works in terms of the iCheck, however, when I do this, the ng-model binding does not work. If I remove the iCheck attribute, it works fine. Any ideas?