Sha256: 8880701ea4b977af7297ba993490bb3aa8e7682b9c5916e8da68554f22de1709
Contents?: true
Size: 1.32 KB
Versions: 34
Compression:
Stored size: 1.32 KB
Contents
var Boolean_ = angular.module("BooleanField", []); /* * <string-field></string-field> directive defination */ Boolean_.directive('booleanField', ["$filter", "gettext", function($filter, gettext) { function link(scope, element, attrs, ngModel){ var ltr = is_ltr(); scope.element_id = "id_" + scope.field; scope.msg_element_id = "id_" + scope.field + "_msg"; if (scope.on_change !== undefined) { // Watch event changes scope.$watch("model", function(newv, oldv, $scope) { // TODO: maybe we should pass locals to $eval scope.$parent.$eval(scope.on_change); }, true); } } // Actual object of <boolean-field> directive return { templateUrl: template("fields/boolean/boolean"), replace: true, restrict: "E", //require: "ngModel", scope: { cssClasses: '=cssClass', // string to shown as label for control label: "@", // fieldname field: "=fieldName", // Does this field is required required: "=", // A call back to pass to field ng-change directive on_change: "@onChange", // Actual Angularjs ng-model model: '=' }, link: link }; }]);
Version data entries
34 entries across 34 versions & 1 rubygems