A component starts out as an ERB file.
Take text_field.component.erb
<% attr_accessor: :value %>
<input type="text" value="<%= value %>" %>Herb then compiles this into a class, which can be instantiated and called to render ERB:
| This is a placeholder file so that the image can be uploaded |
| import PullToRefresh from 'pulltorefreshjs'; | |
| var drawerOrPageShown = false | |
| function afterShowEvent(event){ | |
| const element = event.target | |
| if(element.tagName != "WA-PAGE" && element.tagName != "WA-DRAWER") { | |
| return | |
| } |
A component starts out as an ERB file.
Take text_field.component.erb
<% attr_accessor: :value %>
<input type="text" value="<%= value %>" %>Herb then compiles this into a class, which can be instantiated and called to render ERB:
| # frozen_string_literal: true | |
| class CableCarTemplate | |
| attr_accessor :source | |
| def initialize(&block) | |
| self.source = block | |
| end | |
| def render_in(view_context) |