Sha256: bcf08011e815c1c716217b39ca995b091c90c95b44c796ab70fc94b87972fc38

Contents?: true

Size: 638 Bytes

Versions: 2

Compression:

Stored size: 638 Bytes

Contents

module AngularSprinkles
  module Helpers
    module ElementHelper
      def _ng_element(opts = {}, &block)
        options = opts.dup.symbolize_keys

        scope_name = options.delete(:scope_name)
        html_options = options.delete(:html) || {}
        input_options = options # use remaining options

        content = ng_wrap(scope_name, &block) if block_given?

        input = Element::Input.new(input_options)
        html = Element::Html.new(html_options)

        attributes = Element::Attributes.new([input, html], tag: html.tag, content: content)

        content_tag(*attributes.to_content_tag)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
angular_sprinkles-0.3.3 lib/angular_sprinkles/helpers/element_helper.rb
angular_sprinkles-0.3.2 lib/angular_sprinkles/helpers/element_helper.rb