Module: AngularSprinkles::Helpers::ElementHelper

Included in:
AngularSprinkles::Helpers
Defined in:
lib/angular_sprinkles/helpers/element_helper.rb

Instance Method Summary collapse

Instance Method Details

#_ng_element(opts = {}, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/angular_sprinkles/helpers/element_helper.rb', line 4

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)

  (*attributes.)
end