JSFiddle - React, Tailwind, and code Playground

by James Allardice

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.js"></script>
<div ng-app="test" ng-controller="TestCtrl">
    <ul>
        <li ui-checklist ui-checklist-repeat="a in arr" ui-checklist-array="selected"></li>
    </ul>
</div>

JavaScript

var s = angular.module("test", []);

s.controller("TestCtrl", ["$scope", function ($scope) {
    $scope.arr = [
        { id: "1", value: "One" },
        { id: "2", value: "Two" },
        { id: "3", value: "Three" }
    ];
    $scope.selected = [0, 1];
}]);

s.directive("uiChecklist", [function () {
    return {
        scope: {
            repeater: "@uiChecklistRepeat",
            array: "@uiChecklistArray"
        },
        link: function (scope, elem, attrs) {
            console.log(scope.repeater);
        }
    };
}]);