code: function(scope, attr, defaults) {
        defaults = defaults || {};
        angular.forEach(scope.$$isolateBindings, function(binding, key) {
          if (binding.optional && angular.isUndefined(scope[key])) {
            var attrIsDefined = angular.isDefined(attr[binding.attrName]);
            scope[key] = angular.isDefined(defaults[key]) ? defaults[key] : attrIsDefined;
          }
        });
      }
docs: Give optional properties with no value a boolean true if attr provided or false otherwise