Module: Engine2::ActionAngularSupport

Included in:
ActionFormSupport, Engine2::ActionOnChangeSupport::OnChangeAction
Defined in:
lib/engine2/action.rb

Instance Method Summary collapse

Instance Method Details

#ng_call(name, *args) ⇒ Object



488
489
490
# File 'lib/engine2/action.rb', line 488

def ng_call name, *args
    # TODO
end

#ng_execute(expr) ⇒ Object



462
463
464
# File 'lib/engine2/action.rb', line 462

def ng_execute expr
    (@meta[:execute] ||= String.new) << expr + ";"
end

#ng_info!(name, *selector, expression) ⇒ Object



483
484
485
486
# File 'lib/engine2/action.rb', line 483

def ng_info! name, *selector, expression
    # expression = "'#{expression}'" if expression.is_a? String
    "action.meta.fields['#{name}'].#{selector.join('.')} = #{expression}"
end

#ng_record(name) ⇒ Object



479
480
481
# File 'lib/engine2/action.rb', line 479

def ng_record name
    "action.record['#{name}']"
end

#ng_record!(name, value) ⇒ Object



466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/engine2/action.rb', line 466

def ng_record! name, value
    value = case value
    when String
        "'#{value}'"
    when nil
        'null'
    else
        value
    end

    "action.record['#{name}'] = #{value}"
end